mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] net: Remove a local variable with the same name as the parameter.
@ 2024-08-26  7:35 jiping huang
  2024-08-26  8:30 ` Eric Dumazet
  2024-08-26 19:41 ` kernel test robot
  0 siblings, 2 replies; 3+ messages in thread
From: jiping huang @ 2024-08-26  7:35 UTC (permalink / raw)
  To: davem, dsahern, edumazet, kuba, pabeni; +Cc: netdev, linux-kernel, jiping huang

There is no need to use an additional local avariable to get rtmsg.flags,
and this variable has the same name as the function argument.

Signed-off-by: jiping huang <huangjiping95@qq.com>

diff --git a/net/ipv4/fib_semantics.c b/net/ipv4/fib_semantics.c
index f669da98d11d..0d69267c9971 100644
--- a/net/ipv4/fib_semantics.c
+++ b/net/ipv4/fib_semantics.c
@@ -1830,12 +1830,10 @@ int fib_dump_info(struct sk_buff *skb, u32 portid, u32 seq, int event,
 
 	if (nhs == 1) {
 		const struct fib_nh_common *nhc = fib_info_nhc(fi, 0);
-		unsigned char flags = 0;
 
-		if (fib_nexthop_info(skb, nhc, AF_INET, &flags, false) < 0)
+		if (fib_nexthop_info(skb, nhc, AF_INET, &rtm->rtm_flags, false) < 0)
 			goto nla_put_failure;
 
-		rtm->rtm_flags = flags;
 #ifdef CONFIG_IP_ROUTE_CLASSID
 		if (nhc->nhc_family == AF_INET) {
 			struct fib_nh *nh;
-- 
2.34.1


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2024-08-26 19:42 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-08-26  7:35 [PATCH] net: Remove a local variable with the same name as the parameter jiping huang
2024-08-26  8:30 ` Eric Dumazet
2024-08-26 19:41 ` kernel test robot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®