Blame SOURCES/0010-ioctl-convert-cmdline_info-arrays-to-named-initializ.patch

4f6fcd
From 35fb9ff49c579d6e6819d71ab4c614cb3d2c0dae Mon Sep 17 00:00:00 2001
4f6fcd
From: Michal Kubecek <mkubecek@suse.cz>
4f6fcd
Date: Sun, 23 Aug 2020 21:40:39 +0200
4f6fcd
Subject: [PATCH 10/17] ioctl: convert cmdline_info arrays to named
4f6fcd
 initializers
4f6fcd
4f6fcd
To get rid of remaining "missing field initializer" compiler warnings,
4f6fcd
convert arrays of struct cmdline_info used for command line parser to
4f6fcd
named initializers. This also makes the initializers easier to read.
4f6fcd
4f6fcd
This commit should have no effect on resulting code (checked with gcc-11
4f6fcd
and -O2).
4f6fcd
4f6fcd
Signed-off-by: Michal Kubecek <mkubecek@suse.cz>
4f6fcd
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
4f6fcd
(cherry picked from commit 0c43dec5cf64aee41bbd4195c96671032ea6556d)
4f6fcd
---
4f6fcd
 ethtool.c | 378 ++++++++++++++++++++++++++++++++++++++++++------------
4f6fcd
 1 file changed, 296 insertions(+), 82 deletions(-)
4f6fcd
4f6fcd
diff --git a/ethtool.c b/ethtool.c
4f6fcd
index 3c30824016d5..e32a93b41088 100644
4f6fcd
--- a/ethtool.c
4f6fcd
+++ b/ethtool.c
4f6fcd
@@ -1825,10 +1825,24 @@ static int do_spause(struct cmd_context *ctx)
4f6fcd
 	int pause_rx_wanted = -1;
4f6fcd
 	int pause_tx_wanted = -1;
4f6fcd
 	struct cmdline_info cmdline_pause[] = {
4f6fcd
-		{ "autoneg", CMDL_BOOL, &pause_autoneg_wanted,
4f6fcd
-		  &epause.autoneg },
4f6fcd
-		{ "rx", CMDL_BOOL, &pause_rx_wanted, &epause.rx_pause },
4f6fcd
-		{ "tx", CMDL_BOOL, &pause_tx_wanted, &epause.tx_pause },
4f6fcd
+		{
4f6fcd
+			.name		= "autoneg",
4f6fcd
+			.type		= CMDL_BOOL,
4f6fcd
+			.wanted_val	= &pause_autoneg_wanted,
4f6fcd
+			.ioctl_val	= &epause.autoneg,
4f6fcd
+		},
4f6fcd
+		{
4f6fcd
+			.name		= "rx",
4f6fcd
+			.type		= CMDL_BOOL,
4f6fcd
+			.wanted_val	= &pause_rx_wanted,
4f6fcd
+			.ioctl_val	= &epause.rx_pause,
4f6fcd
+		},
4f6fcd
+		{
4f6fcd
+			.name		= "tx",
4f6fcd
+			.type		= CMDL_BOOL,
4f6fcd
+			.wanted_val	= &pause_tx_wanted,
4f6fcd
+			.ioctl_val	= &epause.tx_pause,
4f6fcd
+		},
4f6fcd
 	};
4f6fcd
 	int err, changed = 0;
4f6fcd
 
4f6fcd
@@ -1868,12 +1882,30 @@ static int do_sring(struct cmd_context *ctx)
4f6fcd
 	s32 ring_rx_jumbo_wanted = -1;
4f6fcd
 	s32 ring_tx_wanted = -1;
4f6fcd
 	struct cmdline_info cmdline_ring[] = {
4f6fcd
-		{ "rx", CMDL_S32, &ring_rx_wanted, &ering.rx_pending },
4f6fcd
-		{ "rx-mini", CMDL_S32, &ring_rx_mini_wanted,
4f6fcd
-		  &ering.rx_mini_pending },
4f6fcd
-		{ "rx-jumbo", CMDL_S32, &ring_rx_jumbo_wanted,
4f6fcd
-		  &ering.rx_jumbo_pending },
4f6fcd
-		{ "tx", CMDL_S32, &ring_tx_wanted, &ering.tx_pending },
4f6fcd
+		{
4f6fcd
+			.name		= "rx",
4f6fcd
+			.type		= CMDL_S32,
4f6fcd
+			.wanted_val	= &ring_rx_wanted,
4f6fcd
+			.ioctl_val	= &ering.rx_pending,
4f6fcd
+		},
4f6fcd
+		{
4f6fcd
+			.name		= "rx-mini",
4f6fcd
+			.type		= CMDL_S32,
4f6fcd
+			.wanted_val	= &ring_rx_mini_wanted,
4f6fcd
+			.ioctl_val	= &ering.rx_mini_pending,
4f6fcd
+		},
4f6fcd
+		{
4f6fcd
+			.name		= "rx-jumbo",
4f6fcd
+			.type		= CMDL_S32,
4f6fcd
+			.wanted_val	= &ring_rx_jumbo_wanted,
4f6fcd
+			.ioctl_val	= &ering.rx_jumbo_pending,
4f6fcd
+		},
4f6fcd
+		{
4f6fcd
+			.name		= "tx",
4f6fcd
+			.type		= CMDL_S32,
4f6fcd
+			.wanted_val	= &ring_tx_wanted,
4f6fcd
+			.ioctl_val	= &ering.tx_pending,
4f6fcd
+		},
4f6fcd
 	};
4f6fcd
 	int err, changed = 0;
4f6fcd
 
4f6fcd
@@ -1937,12 +1969,30 @@ static int do_schannels(struct cmd_context *ctx)
4f6fcd
 	s32 channels_other_wanted = -1;
4f6fcd
 	s32 channels_combined_wanted = -1;
4f6fcd
 	struct cmdline_info cmdline_channels[] = {
4f6fcd
-		{ "rx", CMDL_S32, &channels_rx_wanted, &echannels.rx_count },
4f6fcd
-		{ "tx", CMDL_S32, &channels_tx_wanted, &echannels.tx_count },
4f6fcd
-		{ "other", CMDL_S32, &channels_other_wanted,
4f6fcd
-		  &echannels.other_count },
4f6fcd
-		{ "combined", CMDL_S32, &channels_combined_wanted,
4f6fcd
-		  &echannels.combined_count },
4f6fcd
+		{
4f6fcd
+			.name		= "rx",
4f6fcd
+			.type		= CMDL_S32,
4f6fcd
+			.wanted_val	= &channels_rx_wanted,
4f6fcd
+			.ioctl_val	= &echannels.rx_count,
4f6fcd
+		},
4f6fcd
+		{
4f6fcd
+			.name		= "tx",
4f6fcd
+			.type		= CMDL_S32,
4f6fcd
+			.wanted_val	= &channels_tx_wanted,
4f6fcd
+			.ioctl_val	= &echannels.tx_count,
4f6fcd
+		},
4f6fcd
+		{
4f6fcd
+			.name		= "other",
4f6fcd
+			.type		= CMDL_S32,
4f6fcd
+			.wanted_val	= &channels_other_wanted,
4f6fcd
+			.ioctl_val	= &echannels.other_count,
4f6fcd
+		},
4f6fcd
+		{
4f6fcd
+			.name		= "combined",
4f6fcd
+			.type		= CMDL_S32,
4f6fcd
+			.wanted_val	= &channels_combined_wanted,
4f6fcd
+			.ioctl_val	= &echannels.combined_count,
4f6fcd
+		},
4f6fcd
 	};
4f6fcd
 	int err, changed = 0;
4f6fcd
 
4f6fcd
@@ -2052,50 +2102,138 @@ static int do_gcoalesce(struct cmd_context *ctx)
4f6fcd
 
4f6fcd
 #define COALESCE_CMDLINE_INFO(__ecoal)					\
4f6fcd
 {									\
4f6fcd
-	{ "adaptive-rx", CMDL_BOOL, &coal_adaptive_rx_wanted,		\
4f6fcd
-	  &__ecoal.use_adaptive_rx_coalesce },				\
4f6fcd
-	{ "adaptive-tx", CMDL_BOOL, &coal_adaptive_tx_wanted,		\
4f6fcd
-	  &__ecoal.use_adaptive_tx_coalesce },				\
4f6fcd
-	{ "sample-interval", CMDL_S32, &coal_sample_rate_wanted,	\
4f6fcd
-	  &__ecoal.rate_sample_interval },				\
4f6fcd
-	{ "stats-block-usecs", CMDL_S32, &coal_stats_wanted,		\
4f6fcd
-	  &__ecoal.stats_block_coalesce_usecs },			\
4f6fcd
-	{ "pkt-rate-low", CMDL_S32, &coal_pkt_rate_low_wanted,		\
4f6fcd
-	  &__ecoal.pkt_rate_low },					\
4f6fcd
-	{ "pkt-rate-high", CMDL_S32, &coal_pkt_rate_high_wanted,	\
4f6fcd
-	  &__ecoal.pkt_rate_high },					\
4f6fcd
-	{ "rx-usecs", CMDL_S32, &coal_rx_usec_wanted,			\
4f6fcd
-	  &__ecoal.rx_coalesce_usecs },					\
4f6fcd
-	{ "rx-frames", CMDL_S32, &coal_rx_frames_wanted,		\
4f6fcd
-	  &__ecoal.rx_max_coalesced_frames },				\
4f6fcd
-	{ "rx-usecs-irq", CMDL_S32, &coal_rx_usec_irq_wanted,		\
4f6fcd
-	  &__ecoal.rx_coalesce_usecs_irq },				\
4f6fcd
-	{ "rx-frames-irq", CMDL_S32, &coal_rx_frames_irq_wanted,	\
4f6fcd
-	  &__ecoal.rx_max_coalesced_frames_irq },			\
4f6fcd
-	{ "tx-usecs", CMDL_S32, &coal_tx_usec_wanted,			\
4f6fcd
-	  &__ecoal.tx_coalesce_usecs },					\
4f6fcd
-	{ "tx-frames", CMDL_S32, &coal_tx_frames_wanted,		\
4f6fcd
-	  &__ecoal.tx_max_coalesced_frames },				\
4f6fcd
-	{ "tx-usecs-irq", CMDL_S32, &coal_tx_usec_irq_wanted,		\
4f6fcd
-	  &__ecoal.tx_coalesce_usecs_irq },				\
4f6fcd
-	{ "tx-frames-irq", CMDL_S32, &coal_tx_frames_irq_wanted,	\
4f6fcd
-	  &__ecoal.tx_max_coalesced_frames_irq },			\
4f6fcd
-	{ "rx-usecs-low", CMDL_S32, &coal_rx_usec_low_wanted,		\
4f6fcd
-	  &__ecoal.rx_coalesce_usecs_low },				\
4f6fcd
-	{ "rx-frames-low", CMDL_S32, &coal_rx_frames_low_wanted,	\
4f6fcd
-	  &__ecoal.rx_max_coalesced_frames_low },			\
4f6fcd
-	{ "tx-usecs-low", CMDL_S32, &coal_tx_usec_low_wanted,		\
4f6fcd
-	  &__ecoal.tx_coalesce_usecs_low },				\
4f6fcd
-	{ "tx-frames-low", CMDL_S32, &coal_tx_frames_low_wanted,	\
4f6fcd
-	  &__ecoal.tx_max_coalesced_frames_low },			\
4f6fcd
-	{ "rx-usecs-high", CMDL_S32, &coal_rx_usec_high_wanted,		\
4f6fcd
-	  &__ecoal.rx_coalesce_usecs_high },				\
4f6fcd
-	{ "rx-frames-high", CMDL_S32, &coal_rx_frames_high_wanted,	\
4f6fcd
-	  &__ecoal.rx_max_coalesced_frames_high },			\
4f6fcd
-	{ "tx-usecs-high", CMDL_S32, &coal_tx_usec_high_wanted,		\
4f6fcd
-	  &__ecoal.tx_coalesce_usecs_high },				\
4f6fcd
-	{ "tx-frames-high", CMDL_S32, &coal_tx_frames_high_wanted,	\
4f6fcd
-	  &__ecoal.tx_max_coalesced_frames_high },			\
4f6fcd
+	{								\
4f6fcd
+		.name		= "adaptive-rx",			\
4f6fcd
+		.type		= CMDL_BOOL,				\
4f6fcd
+		.wanted_val	= &coal_adaptive_rx_wanted,		\
4f6fcd
+		.ioctl_val	= &__ecoal.use_adaptive_rx_coalesce,	\
4f6fcd
+	},								\
4f6fcd
+	{								\
4f6fcd
+		.name		= "adaptive-tx",			\
4f6fcd
+		.type		= CMDL_BOOL,				\
4f6fcd
+		.wanted_val	= &coal_adaptive_tx_wanted,		\
4f6fcd
+		.ioctl_val	= &__ecoal.use_adaptive_tx_coalesce,	\
4f6fcd
+	},								\
4f6fcd
+	{								\
4f6fcd
+		.name		= "sample-interval",			\
4f6fcd
+		.type		= CMDL_S32,				\
4f6fcd
+		.wanted_val	= &coal_sample_rate_wanted,		\
4f6fcd
+		.ioctl_val	= &__ecoal.rate_sample_interval,	\
4f6fcd
+	},								\
4f6fcd
+	{								\
4f6fcd
+		.name		= "stats-block-usecs",			\
4f6fcd
+		.type		= CMDL_S32,				\
4f6fcd
+		.wanted_val	= &coal_stats_wanted,			\
4f6fcd
+		.ioctl_val	= &__ecoal.stats_block_coalesce_usecs,	\
4f6fcd
+	},								\
4f6fcd
+	{								\
4f6fcd
+		.name		= "pkt-rate-low",			\
4f6fcd
+		.type		= CMDL_S32,				\
4f6fcd
+		.wanted_val	= &coal_pkt_rate_low_wanted,		\
4f6fcd
+		.ioctl_val	= &__ecoal.pkt_rate_low,		\
4f6fcd
+	},								\
4f6fcd
+	{								\
4f6fcd
+		.name		= "pkt-rate-high",			\
4f6fcd
+		.type		= CMDL_S32,				\
4f6fcd
+		.wanted_val	= &coal_pkt_rate_high_wanted,		\
4f6fcd
+		.ioctl_val	= &__ecoal.pkt_rate_high,		\
4f6fcd
+	},								\
4f6fcd
+	{								\
4f6fcd
+		.name		= "rx-usecs",				\
4f6fcd
+		.type		= CMDL_S32,				\
4f6fcd
+		.wanted_val	= &coal_rx_usec_wanted,			\
4f6fcd
+		.ioctl_val	= &__ecoal.rx_coalesce_usecs,		\
4f6fcd
+	},								\
4f6fcd
+	{								\
4f6fcd
+		.name		= "rx-frames",				\
4f6fcd
+		.type		= CMDL_S32,				\
4f6fcd
+		.wanted_val	= &coal_rx_frames_wanted,		\
4f6fcd
+		.ioctl_val	= &__ecoal.rx_max_coalesced_frames,	\
4f6fcd
+	},								\
4f6fcd
+	{								\
4f6fcd
+		.name		= "rx-usecs-irq",			\
4f6fcd
+		.type		= CMDL_S32,				\
4f6fcd
+		.wanted_val	= &coal_rx_usec_irq_wanted,		\
4f6fcd
+		.ioctl_val	= &__ecoal.rx_coalesce_usecs_irq,	\
4f6fcd
+	},								\
4f6fcd
+	{								\
4f6fcd
+		.name		= "rx-frames-irq",			\
4f6fcd
+		.type		= CMDL_S32,				\
4f6fcd
+		.wanted_val	= &coal_rx_frames_irq_wanted,		\
4f6fcd
+		.ioctl_val	= &__ecoal.rx_max_coalesced_frames_irq,	\
4f6fcd
+	},								\
4f6fcd
+	{								\
4f6fcd
+		.name		= "tx-usecs",				\
4f6fcd
+		.type		= CMDL_S32,				\
4f6fcd
+		.wanted_val	= &coal_tx_usec_wanted,			\
4f6fcd
+		.ioctl_val	= &__ecoal.tx_coalesce_usecs,		\
4f6fcd
+	},								\
4f6fcd
+	{								\
4f6fcd
+		.name		= "tx-frames",				\
4f6fcd
+		.type		= CMDL_S32,				\
4f6fcd
+		.wanted_val	= &coal_tx_frames_wanted,		\
4f6fcd
+		.ioctl_val	= &__ecoal.tx_max_coalesced_frames,	\
4f6fcd
+	},								\
4f6fcd
+	{								\
4f6fcd
+		.name		= "tx-usecs-irq",			\
4f6fcd
+		.type		= CMDL_S32,				\
4f6fcd
+		.wanted_val	= &coal_tx_usec_irq_wanted,		\
4f6fcd
+		.ioctl_val	= &__ecoal.tx_coalesce_usecs_irq,	\
4f6fcd
+	},								\
4f6fcd
+	{								\
4f6fcd
+		.name		= "tx-frames-irq",			\
4f6fcd
+		.type		= CMDL_S32,				\
4f6fcd
+		.wanted_val	= &coal_tx_frames_irq_wanted,		\
4f6fcd
+		.ioctl_val	= &__ecoal.tx_max_coalesced_frames_irq,	\
4f6fcd
+	},								\
4f6fcd
+	{								\
4f6fcd
+		.name		= "rx-usecs-low",			\
4f6fcd
+		.type		= CMDL_S32,				\
4f6fcd
+		.wanted_val	= &coal_rx_usec_low_wanted,		\
4f6fcd
+		.ioctl_val	= &__ecoal.rx_coalesce_usecs_low,	\
4f6fcd
+	},								\
4f6fcd
+	{								\
4f6fcd
+		.name		= "rx-frames-low",			\
4f6fcd
+		.type		= CMDL_S32,				\
4f6fcd
+		.wanted_val	= &coal_rx_frames_low_wanted,		\
4f6fcd
+		.ioctl_val	= &__ecoal.rx_max_coalesced_frames_low,	\
4f6fcd
+	},								\
4f6fcd
+	{								\
4f6fcd
+		.name		= "tx-usecs-low",			\
4f6fcd
+		.type		= CMDL_S32,				\
4f6fcd
+		.wanted_val	= &coal_tx_usec_low_wanted,		\
4f6fcd
+		.ioctl_val	= &__ecoal.tx_coalesce_usecs_low,	\
4f6fcd
+	},								\
4f6fcd
+	{								\
4f6fcd
+		.name		= "tx-frames-low",			\
4f6fcd
+		.type		= CMDL_S32,				\
4f6fcd
+		.wanted_val	= &coal_tx_frames_low_wanted,		\
4f6fcd
+		.ioctl_val	= &__ecoal.tx_max_coalesced_frames_low,	\
4f6fcd
+	},								\
4f6fcd
+	{								\
4f6fcd
+		.name		= "rx-usecs-high",			\
4f6fcd
+		.type		= CMDL_S32,				\
4f6fcd
+		.wanted_val	= &coal_rx_usec_high_wanted,		\
4f6fcd
+		.ioctl_val	= &__ecoal.rx_coalesce_usecs_high,	\
4f6fcd
+	},								\
4f6fcd
+	{								\
4f6fcd
+		.name		= "rx-frames-high",			\
4f6fcd
+		.type		= CMDL_S32,				\
4f6fcd
+		.wanted_val	= &coal_rx_frames_high_wanted,		\
4f6fcd
+		.ioctl_val	= &__ecoal.rx_max_coalesced_frames_high,\
4f6fcd
+	},								\
4f6fcd
+	{								\
4f6fcd
+		.name		= "tx-usecs-high",			\
4f6fcd
+		.type		= CMDL_S32,				\
4f6fcd
+		.wanted_val	= &coal_tx_usec_high_wanted,		\
4f6fcd
+		.ioctl_val	= &__ecoal.tx_coalesce_usecs_high,	\
4f6fcd
+	},								\
4f6fcd
+	{								\
4f6fcd
+		.name		= "tx-frames-high",			\
4f6fcd
+		.type		= CMDL_S32,				\
4f6fcd
+		.wanted_val	= &coal_tx_frames_high_wanted,		\
4f6fcd
+		.ioctl_val	= &__ecoal.tx_max_coalesced_frames_high,\
4f6fcd
+	},								\
4f6fcd
 }
4f6fcd
 
4f6fcd
 static int do_scoalesce(struct cmd_context *ctx)
4f6fcd
@@ -3090,9 +3228,21 @@ static int do_gregs(struct cmd_context *ctx)
4f6fcd
 	int gregs_dump_hex = 0;
4f6fcd
 	char *gregs_dump_file = NULL;
4f6fcd
 	struct cmdline_info cmdline_gregs[] = {
4f6fcd
-		{ "raw", CMDL_BOOL, &gregs_dump_raw, NULL },
4f6fcd
-		{ "hex", CMDL_BOOL, &gregs_dump_hex, NULL },
4f6fcd
-		{ "file", CMDL_STR, &gregs_dump_file, NULL },
4f6fcd
+		{
4f6fcd
+			.name		= "raw",
4f6fcd
+			.type		= CMDL_BOOL,
4f6fcd
+			.wanted_val	= &gregs_dump_raw,
4f6fcd
+		},
4f6fcd
+		{
4f6fcd
+			.name		= "hex",
4f6fcd
+			.type		= CMDL_BOOL,
4f6fcd
+			.wanted_val	= &gregs_dump_hex,
4f6fcd
+		},
4f6fcd
+		{
4f6fcd
+			.name		= "file",
4f6fcd
+			.type		= CMDL_STR,
4f6fcd
+			.wanted_val	= &gregs_dump_file,
4f6fcd
+		},
4f6fcd
 	};
4f6fcd
 	int err;
4f6fcd
 	struct ethtool_drvinfo drvinfo;
4f6fcd
@@ -3189,10 +3339,22 @@ static int do_geeprom(struct cmd_context *ctx)
4f6fcd
 	u32 geeprom_length = 0;
4f6fcd
 	int geeprom_length_seen = 0;
4f6fcd
 	struct cmdline_info cmdline_geeprom[] = {
4f6fcd
-		{ "offset", CMDL_U32, &geeprom_offset, NULL },
4f6fcd
-		{ "length", CMDL_U32, &geeprom_length, NULL,
4f6fcd
-		  0, &geeprom_length_seen },
4f6fcd
-		{ "raw", CMDL_BOOL, &geeprom_dump_raw, NULL },
4f6fcd
+		{
4f6fcd
+			.name		= "offset",
4f6fcd
+			.type		= CMDL_U32,
4f6fcd
+			.wanted_val	= &geeprom_offset,
4f6fcd
+		},
4f6fcd
+		{
4f6fcd
+			.name		= "length",
4f6fcd
+			.type		= CMDL_U32,
4f6fcd
+			.wanted_val	= &geeprom_length,
4f6fcd
+			.seen_val	= &geeprom_length_seen,
4f6fcd
+		},
4f6fcd
+		{
4f6fcd
+			.name		= "raw",
4f6fcd
+			.type		= CMDL_BOOL,
4f6fcd
+			.wanted_val	= &geeprom_dump_raw,
4f6fcd
+		},
4f6fcd
 	};
4f6fcd
 	int err;
4f6fcd
 	struct ethtool_drvinfo drvinfo;
4f6fcd
@@ -3244,12 +3406,28 @@ static int do_seeprom(struct cmd_context *ctx)
4f6fcd
 	int seeprom_length_seen = 0;
4f6fcd
 	int seeprom_value_seen = 0;
4f6fcd
 	struct cmdline_info cmdline_seeprom[] = {
4f6fcd
-		{ "magic", CMDL_U32, &seeprom_magic, NULL },
4f6fcd
-		{ "offset", CMDL_U32, &seeprom_offset, NULL },
4f6fcd
-		{ "length", CMDL_U32, &seeprom_length, NULL,
4f6fcd
-		  0, &seeprom_length_seen },
4f6fcd
-		{ "value", CMDL_U8, &seeprom_value, NULL,
4f6fcd
-		  0, &seeprom_value_seen },
4f6fcd
+		{
4f6fcd
+			.name		= "magic",
4f6fcd
+			.type		= CMDL_U32,
4f6fcd
+			.wanted_val	= &seeprom_magic,
4f6fcd
+		},
4f6fcd
+		{
4f6fcd
+			.name		= "offset",
4f6fcd
+			.type		= CMDL_U32,
4f6fcd
+			.wanted_val	= &seeprom_offset,
4f6fcd
+		},
4f6fcd
+		{
4f6fcd
+			.name		= "length",
4f6fcd
+			.type		= CMDL_U32,
4f6fcd
+			.wanted_val	= &seeprom_length,
4f6fcd
+			.seen_val	= &seeprom_length_seen,
4f6fcd
+		},
4f6fcd
+		{
4f6fcd
+			.name		= "value",
4f6fcd
+			.type		= CMDL_U8,
4f6fcd
+			.wanted_val	= &seeprom_value,
4f6fcd
+			.seen_val	= &seeprom_value_seen,
4f6fcd
+		},
4f6fcd
 	};
4f6fcd
 	int err;
4f6fcd
 	struct ethtool_drvinfo drvinfo;
4f6fcd
@@ -4553,11 +4731,27 @@ static int do_getmodule(struct cmd_context *ctx)
4f6fcd
 	int err;
4f6fcd
 
4f6fcd
 	struct cmdline_info cmdline_geeprom[] = {
4f6fcd
-		{ "offset", CMDL_U32, &geeprom_offset, NULL },
4f6fcd
-		{ "length", CMDL_U32, &geeprom_length, NULL,
4f6fcd
-		  0, &geeprom_length_seen },
4f6fcd
-		{ "raw", CMDL_BOOL, &geeprom_dump_raw, NULL },
4f6fcd
-		{ "hex", CMDL_BOOL, &geeprom_dump_hex, NULL },
4f6fcd
+		{
4f6fcd
+			.name		= "offset",
4f6fcd
+			.type		= CMDL_U32,
4f6fcd
+			.wanted_val	= &geeprom_offset,
4f6fcd
+		},
4f6fcd
+		{
4f6fcd
+			.name		= "length",
4f6fcd
+			.type		= CMDL_U32,
4f6fcd
+			.wanted_val	= &geeprom_length,
4f6fcd
+			.seen_val	= &geeprom_length_seen,
4f6fcd
+		},
4f6fcd
+		{
4f6fcd
+			.name		= "raw",
4f6fcd
+			.type		= CMDL_BOOL,
4f6fcd
+			.wanted_val	= &geeprom_dump_raw,
4f6fcd
+		},
4f6fcd
+		{
4f6fcd
+			.name		= "hex",
4f6fcd
+			.type		= CMDL_BOOL,
4f6fcd
+			.wanted_val	= &geeprom_dump_hex,
4f6fcd
+		},
4f6fcd
 	};
4f6fcd
 
4f6fcd
 	parse_generic_cmdline(ctx, &geeprom_changed,
4f6fcd
@@ -4669,10 +4863,30 @@ static int do_seee(struct cmd_context *ctx)
4f6fcd
 	int change = -1, change2 = 0;
4f6fcd
 	struct ethtool_eee eeecmd;
4f6fcd
 	struct cmdline_info cmdline_eee[] = {
4f6fcd
-		{ "advertise",    CMDL_U32,  &adv_c,       &eeecmd.advertised },
4f6fcd
-		{ "tx-lpi",       CMDL_BOOL, &lpi_c,   &eeecmd.tx_lpi_enabled },
4f6fcd
-		{ "tx-timer",	  CMDL_U32,  &lpi_time_c, &eeecmd.tx_lpi_timer},
4f6fcd
-		{ "eee",	  CMDL_BOOL, &eee_c,	   &eeecmd.eee_enabled},
4f6fcd
+		{
4f6fcd
+			.name		= "advertise",
4f6fcd
+			.type		= CMDL_U32,
4f6fcd
+			.wanted_val	= &adv_c,
4f6fcd
+			.ioctl_val	= &eeecmd.advertised,
4f6fcd
+		},
4f6fcd
+		{
4f6fcd
+			.name		= "tx-lpi",
4f6fcd
+			.type		= CMDL_BOOL,
4f6fcd
+			.wanted_val	= &lpi_c,
4f6fcd
+			.ioctl_val	= &eeecmd.tx_lpi_enabled,
4f6fcd
+		},
4f6fcd
+		{
4f6fcd
+			.name		= "tx-timer",
4f6fcd
+			.type		= CMDL_U32,
4f6fcd
+			.wanted_val	= &lpi_time_c,
4f6fcd
+			.ioctl_val	= &eeecmd.tx_lpi_timer,
4f6fcd
+		},
4f6fcd
+		{
4f6fcd
+			.name		= "eee",
4f6fcd
+			.type		= CMDL_BOOL,
4f6fcd
+			.wanted_val	= &eee_c,
4f6fcd
+			.ioctl_val	= &eeecmd.eee_enabled,
4f6fcd
+		},
4f6fcd
 	};
4f6fcd
 
4f6fcd
 	if (ctx->argc == 0)
4f6fcd
-- 
4f6fcd
2.26.2
4f6fcd