Thread (14 messages) 14 messages, 2 authors, 2018-03-06

[PATCH iproute2-next v2 06/12] tcp_metrics; make tables const

flat view
STALE3150d

From: Stephen Hemminger <stephen@networkplumber.org>
Date: 2018-03-06 21:07:32
Subsystem: the rest · Maintainer: Linus Torvalds

From: Stephen Hemminger <redacted>

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
 ip/tcp_metrics.c | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)
diff --git a/ip/tcp_metrics.c b/ip/tcp_metrics.c
index 7e2d9eb34b79..5f394765c62b 100644
--- a/ip/tcp_metrics.c
+++ b/ip/tcp_metrics.c
@@ -47,8 +47,8 @@ static int genl_family = -1;
 #define CMD_DEL		0x0002	/* delete, remove		*/
 #define CMD_FLUSH	0x0004	/* flush			*/
 
-static struct {
-	char	*name;
+static const struct {
+	const char *name;
 	int	code;
 } cmds[] = {
 	{	"list",		CMD_LIST	},
@@ -59,7 +59,7 @@ static struct {
 	{	"flush",	CMD_FLUSH	},
 };
 
-static char *metric_name[TCP_METRIC_MAX + 1] = {
+static const char *metric_name[TCP_METRIC_MAX + 1] = {
 	[TCP_METRIC_RTT]		= "rtt",
 	[TCP_METRIC_RTTVAR]		= "rttvar",
 	[TCP_METRIC_SSTHRESH]		= "ssthresh",
@@ -67,8 +67,7 @@ static char *metric_name[TCP_METRIC_MAX + 1] = {
 	[TCP_METRIC_REORDERING]		= "reordering",
 };
 
-static struct
-{
+static struct {
 	int flushed;
 	char *flushb;
 	int flushp;
-- 
2.16.1
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help