Netdev List
 help / color / mirror / Atom feed
From: Stephen Hemminger <stephen@networkplumber.org>
To: netdev@vger.kernel.org
Cc: dsahern@kernel.org, Stephen Hemminger <stephen@networkplumber.org>
Subject: [PATCH iproute2-next 01/10] xfrm: rename shadowed SA direction local
Date: Mon, 30 Nov 2026 10:47:02 -0800	[thread overview]
Message-ID: <20261130184752.545119-2-stephen@networkplumber.org> (raw)
In-Reply-To: <20261130184752.545119-1-stephen@networkplumber.org>

xfrm_xfrma_print() takes a bool parameter named "dir" that selects
whether the direction is printed.  The XFRMA_SA_DIR block declares a
__u8 local of the same name holding the attribute value, so the two
distinct meanings share one identifier and the local hides the
parameter for the rest of the block.

Rename the local to sa_dir.  No change in output; the fallback that
prints an unrecognized direction keeps reporting the attribute value
rather than the print flag.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
 ip/ipxfrm.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/ip/ipxfrm.c b/ip/ipxfrm.c
index 78d9e192..4a63dc16 100644
--- a/ip/ipxfrm.c
+++ b/ip/ipxfrm.c
@@ -908,15 +908,15 @@ void xfrm_xfrma_print(struct rtattr *tb[], __u16 family, FILE *fp,
 		fprintf(fp, "%s", _SL_);
 	}
 	if (tb[XFRMA_SA_DIR]) {
-		__u8 dir = rta_getattr_u8(tb[XFRMA_SA_DIR]);
+		__u8 sa_dir = rta_getattr_u8(tb[XFRMA_SA_DIR]);
 
 		fprintf(fp, "\tdir ");
-		if (dir == XFRM_SA_DIR_IN)
+		if (sa_dir == XFRM_SA_DIR_IN)
 			fprintf(fp, "in");
-		else if (dir == XFRM_SA_DIR_OUT)
+		else if (sa_dir == XFRM_SA_DIR_OUT)
 			fprintf(fp, "out");
 		else
-			fprintf(fp, "other (%d)", dir);
+			fprintf(fp, "other (%d)", sa_dir);
 		fprintf(fp, "%s", _SL_);
 	}
 	if (tb[XFRMA_SA_PCPU]) {
-- 
2.53.0


  reply	other threads:[~2026-11-30 19:11 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-30 18:47 [PATCH iproute2-next 00/10] fix shadowed variable warnings Stephen Hemminger
2026-11-30 18:47 ` Stephen Hemminger [this message]
2026-11-30 18:47 ` [PATCH iproute2-next 02/10] ip address: rename the shadowed parameter of ipaddr_reset_filter() Stephen Hemminger
2026-11-30 18:47 ` [PATCH iproute2-next 03/10] lib: rename parameters that shadow globals Stephen Hemminger
2026-11-30 18:47 ` [PATCH iproute2-next 04/10] xfrm: rename local netlink handles that shadow the global rth Stephen Hemminger
2026-11-30 18:47 ` [PATCH iproute2-next 05/10] tc: rename and drop shadowing locals Stephen Hemminger
2026-11-30 18:47 ` [PATCH iproute2-next 06/10] ip: " Stephen Hemminger
2026-11-30 18:47 ` [PATCH iproute2-next 07/10] ifstat: rename shadowing local Stephen Hemminger
2026-11-30 18:47 ` [PATCH iproute2-next 08/10] bridge, devlink, rdma: rename shadowing locals Stephen Hemminger
2026-11-30 18:47 ` [PATCH iproute2-next 09/10] ss: fix shadowed variable warnings Stephen Hemminger
2026-11-30 18:47 ` [PATCH iproute2-next 10/10] Makefile: enable " Stephen Hemminger

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20261130184752.545119-2-stephen@networkplumber.org \
    --to=stephen@networkplumber.org \
    --cc=dsahern@kernel.org \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox