Skip to contentSkip to conversation

netshaper: remove unused variable

PATCH Applied Stephen Hemminger 2 participants 2 messages Nov 8, 2025 – Nov 9, 2025

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 netshaper: remove unused variable

Clang complains that the variable 'n' used for nlmsghdr is passed uninitiailized. Remove it because it is never used.

Fixes 6f7779ad4ef6 ("netshaper: Add netshaper command")
---
 netshaper/netshaper.c | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)
netshaper/netshaper.c +4 -5
index edd964c1..47fb805e 100644
@@ -98,7 +98,7 @@ static void print_netshaper_attrs(struct nlmsghdr *answer)
 	}
 }
 
-static int do_cmd(int argc, char **argv, struct nlmsghdr *n, int cmd)
+static int do_cmd(int argc, char **argv, int cmd)
 {
 	GENL_REQUEST(req, 1024, genl_family, 0, NET_SHAPER_FAMILY_VERSION, cmd,
 		     NLM_F_REQUEST | NLM_F_ACK);
@@ -220,7 +220,6 @@ static int do_cmd(int argc, char **argv, struct nlmsghdr *n, int cmd)
 
 int main(int argc, char **argv)
 {
-	struct nlmsghdr *n;
 	int color = default_color_opt();
 
 	while (argc > 1) {
@@ -258,11 +257,11 @@ int main(int argc, char **argv)
 		argv++;
 
 		if (strcmp(*argv, "set") == 0)
-			return do_cmd(argc - 1, argv + 1, n, NET_SHAPER_CMD_SET);
+			return do_cmd(argc - 1, argv + 1, NET_SHAPER_CMD_SET);
 		if (strcmp(*argv, "delete") == 0)
-			return do_cmd(argc - 1, argv + 1, n, NET_SHAPER_CMD_DELETE);
+			return do_cmd(argc - 1, argv + 1, NET_SHAPER_CMD_DELETE);
 		if (strcmp(*argv, "show") == 0)
-			return do_cmd(argc - 1, argv + 1, n, NET_SHAPER_CMD_GET);
+			return do_cmd(argc - 1, argv + 1, NET_SHAPER_CMD_GET);
 		if (strcmp(*argv, "help") == 0) {
 			usage();
 			return 0;
Signature · 1 line
2.51.0
#1 lore raw
This patch was applied to iproute2/iproute2.git (main) by Stephen Hemminger <[email protected]>:

Hello:

This patch was applied to iproute2/iproute2.git (main) by Stephen Hemminger <[email protected]>:

Quoted 9 lines · On Sat, 8 Nov 2025 09:35:26 -0800 you wrote:

Clang complains that the variable 'n' used for nlmsghdr is passed uninitiailized. Remove it because it is never used.

Fixes 6f7779ad4ef6 ("netshaper: Add netshaper command")

[...]

Here is the summary with links:
- [iproute2] netshaper: remove unused variable

    https://git.kernel.org/pub/scm/network/iproute2/iproute2.git/commit/?id=9282ff21af89

You are awesome, thank you!

Signature · 2 lines
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html