The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: Yuntao Wang <yuntao.wang@linux.dev>
To: linux-kbuild@vger.kernel.org, linux-kernel@vger.kernel.org
Cc: Masahiro Yamada <masahiroy@kernel.org>,
	Nathan Chancellor <nathan@kernel.org>,
	Nicolas Schier <nsc@kernel.org>,
	Rasmus Villemoes <linux@rasmusvillemoes.dk>,
	Yuntao Wang <yuntao.wang@linux.dev>
Subject: [PATCH] setlocalversion: make tag local to try_tag()
Date: Sun, 23 Aug 2026 17:49:13 +0800	[thread overview]
Message-ID: <20260823094913.421144-1-yuntao.wang@linux.dev> (raw)

The tag variable is only used by try_tag(), but is currently declared
local to scm_version() and modified by try_tag().

Make tag local to try_tag() instead and remove the unused declaration
from scm_version().

No functional changes.

Signed-off-by: Yuntao Wang <yuntao.wang@linux.dev>
---
 scripts/setlocalversion | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/scripts/setlocalversion b/scripts/setlocalversion
index 28169d7e143b..f264c2460ad7 100755
--- a/scripts/setlocalversion
+++ b/scripts/setlocalversion
@@ -33,7 +33,7 @@ if test $# -gt 0 -o ! -d "$srctree"; then
 fi
 
 try_tag() {
-	tag="$1"
+	local tag="$1"
 
 	# Is $tag an annotated tag?
 	if [ "$(git cat-file -t "$tag" 2> /dev/null)" != tag ]; then
@@ -59,7 +59,6 @@ scm_version()
 {
 	local short=false
 	local no_dirty=false
-	local tag
 
 	while [ $# -gt 0 ];
 	do
-- 
2.55.0


             reply	other threads:[~2026-08-23  9:50 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-23  9:49 Yuntao Wang [this message]
2026-08-25 13:49 ` [PATCH] setlocalversion: make tag local to try_tag() Nicolas Schier

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=20260823094913.421144-1-yuntao.wang@linux.dev \
    --to=yuntao.wang@linux.dev \
    --cc=linux-kbuild@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@rasmusvillemoes.dk \
    --cc=masahiroy@kernel.org \
    --cc=nathan@kernel.org \
    --cc=nsc@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