[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20230522175401.1232921-1-dario.binacchi@amarulasolutions.com>
Date: Mon, 22 May 2023 19:54:01 +0200
From: Dario Binacchi <dario.binacchi@...rulasolutions.com>
To: netdev@...r.kernel.org
Cc: Michal Kubecek <mkubecek@...e.cz>,
Sudheer Mogilappagari <sudheer.mogilappagari@...el.com>,
Dario Binacchi <dario.binacchi@...rulasolutions.com>
Subject: [PATCH ethtool v2, 1/1] netlink/rss: move variable declaration out of the for loop
The patch fixes this compilation error:
netlink/rss.c: In function 'rss_reply_cb':
netlink/rss.c:166:3: error: 'for' loop initial declarations are only allowed in C99 mode
for (unsigned int i = 0; i < get_count(hash_funcs); i++) {
^
netlink/rss.c:166:3: note: use option -std=c99 or -std=gnu99 to compile your code
The project doesn't really need a C99 compiler, so let's move the variable
declaration outside the for loop.
Signed-off-by: Dario Binacchi <dario.binacchi@...rulasolutions.com>
---
Changes in v2:
- Change 'int' to 'unsigned int'.
---
netlink/rss.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/netlink/rss.c b/netlink/rss.c
index 4ad6065ef698..a31c10aeca95 100644
--- a/netlink/rss.c
+++ b/netlink/rss.c
@@ -93,6 +93,7 @@ int rss_reply_cb(const struct nlmsghdr *nlhdr, void *data)
bool silent;
int err_ret;
int ret;
+ unsigned int i;
silent = nlctx->is_dump || nlctx->is_monitor;
err_ret = silent ? MNL_CB_OK : MNL_CB_ERROR;
@@ -163,7 +164,7 @@ int rss_reply_cb(const struct nlmsghdr *nlhdr, void *data)
printf(" Operation not supported\n");
return 0;
}
- for (unsigned int i = 0; i < get_count(hash_funcs); i++) {
+ for (i = 0; i < get_count(hash_funcs); i++) {
printf(" %s: %s\n", get_string(hash_funcs, i),
(rss_hfunc & (1 << i)) ? "on" : "off");
}
--
2.32.0
Powered by blists - more mailing lists