Skip to contentSkip to conversation

arch/sparc32: remove unused variable strtab

PATCH In review [email protected] 3 participants 3 messages Jan 12 – Feb 2 SPARC + UltraSPARC (sparc/sparc64)

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 arch/sparc32: remove unused variable strtab

From: Alex Shi <[email protected]>

The commit 1b35a57b1c178 ("sparc32: Kill off software 32-bit multiply/divide
routines") removed the last usage of strtab in funtion module_frob_arch_sections
Therefore, it can be removed now.

---
 arch/sparc/kernel/module.c | 2 --
 1 file changed, 2 deletions(-)
arch/sparc/kernel/module.c +0 -2
index 49740450a685..2a8770369beb 100644
@@ -29,7 +29,6 @@ int module_frob_arch_sections(Elf_Ehdr *hdr,
 {
 	unsigned int symidx;
 	Elf_Sym *sym;
-	char *strtab;
 	int i;
 
 	for (symidx = 0; sechdrs[symidx].sh_type != SHT_SYMTAB; symidx++) {
@@ -39,7 +38,6 @@ int module_frob_arch_sections(Elf_Ehdr *hdr,
 		}
 	}
 	sym = (Elf_Sym *)sechdrs[symidx].sh_addr;
-	strtab = (char *)sechdrs[sechdrs[symidx].sh_link].sh_addr;
 
 	for (i = 1; i < sechdrs[symidx].sh_size / sizeof(Elf_Sym); i++) {
 		if (sym[i].st_shndx == SHN_UNDEF) {
Signature · 1 line
2.43.0
maintainer
#1 lore raw
Quoted 1 line

[PATCH] arch/sparc32: remove unused variable strtab

Although the commit that made it unused did changes for sparc32, this cleanup is not only for sparc32. Also, no need for the "arch/". Please use "sparc:" instead of "arch/sparc32".

Quoted 7 lines · On 2026-01-12 07:37, [email protected] wrote:

From: Alex Shi <[email protected]>

The commit 1b35a57b1c178 ("sparc32: Kill off software 32-bit multiply/divide
routines") removed the last usage of strtab in funtion module_frob_arch_sections
Therefore, it can be removed now.

Did the kernel test robot also suggest a "Closes:" line as well? If so, please also add that.

Quoted 20 lines
---
 arch/sparc/kernel/module.c | 2 --
 1 file changed, 2 deletions(-)
arch/sparc/kernel/module.c +0 -1
index 49740450a685..2a8770369beb 100644
@@ -29,7 +29,6 @@ int module_frob_arch_sections(Elf_Ehdr *hdr,
 {
 	unsigned int symidx;
 	Elf_Sym *sym;
-	char *strtab;
 	int i;
 
 	for (symidx = 0; sechdrs[symidx].sh_type != SHT_SYMTAB; symidx++) {

arch/sparc/kernel/module.c int module_frob_arch_sections(Elf_Ehdr *hdr, · line 43

Quoted 7 lines
arch/sparc/kernel/module.c +0 -1
@@ -39,7 +38,6 @@ int module_frob_arch_sections(Elf_Ehdr *hdr,
 		}
 	}
 	sym = (Elf_Sym *)sechdrs[symidx].sh_addr;
-	strtab = (char *)sechdrs[sechdrs[symidx].sh_link].sh_addr;
 
 	for (i = 1; i < sechdrs[symidx].sh_size / sizeof(Elf_Sym); i++) {
 		if (sym[i].st_shndx == SHN_UNDEF) {

Other than the above, LGTM.

Thanks,
Andreas

#2 lore raw
Quoted 6 lines · Andreas Larsson <[email protected]> 于2026年1月27日周二 00:54写道:
Quoted 2 lines

[PATCH] arch/sparc32: remove unused variable strtab

Although the commit that made it unused did changes for sparc32, this cleanup is not only for sparc32. Also, no need for the "arch/". Please use "sparc:" instead of "arch/sparc32".

Got it. Thanks for point it out. I will fix it in next version.

Quoted 13 lines · On 2026-01-12 07:37, [email protected] wrote:
Quoted 7 lines

From: Alex Shi <[email protected]>

The commit 1b35a57b1c178 ("sparc32: Kill off software 32-bit multiply/divide
routines") removed the last usage of strtab in funtion module_frob_arch_sections
Therefore, it can be removed now.

Did the kernel test robot also suggest a "Closes:" line as well? If so, please also add that.

This issue is also found in a lkp report for my testing code on sparc. In that report, lkp just focus on my another issue.
But since it is just a simple change, is it fine without the 'Closes'?

Thanks
Alex