Skip to contentSkip to conversation

setlocalversion: make tag local to try_tag()

PATCH In review Yuntao Wang 3 participants 3 messages Aug 23 – Sep 1 Kbuild

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 setlocalversion: make tag local to try_tag()

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.

---
 scripts/setlocalversion | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
scripts/setlocalversion +1 -2
index 28169d7e143b..f264c2460ad7 100755
@@ -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
Signature · 1 line
2.55.0
maintainer Reviewed-by on v1 1/1
#1 lore raw
Quoted 6 lines · Yuntao Wang

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().

Quoted 7 lines

No functional changes.

---
 scripts/setlocalversion | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
Signature · 1 line
Nicolas
#2 lore raw
In reply to Yuntao Wang
Quoted 1 line · Yuntao Wang

setlocalversion: make tag local to try_tag()

Applied to

https://git.kernel.org/pub/scm/linux/kernel/git/kbuild/linux.git kbuild-next-unstable

Thanks!

[1/1] setlocalversion: make tag local to try_tag()

      https://git.kernel.org/kbuild/c/ba0e6a6f0fe7a

Please look out for regression or issue reports or other follow up comments, as they may result in the patch/series getting dropped or reverted. Patches applied to an "unstable" branch are accepted pending wider testing in -next and any post-commit review; they will generally be moved to the main branch in a week if no issues are found.

Best regards,

Signature · 2 lines
Cheers,
Nathan