arch/sparc: fix unused vaiable warning error
PATCH 1/1 arch/sparc: fix unused vaiable warning error
From: Alex Shi <[email protected]>
arch/sparc/mm/init_64.c: In function 'arch_hugetlb_valid_size':
arch/sparc/mm/init_64.c:361:24: warning: variable 'hv_pgsz_idx' set but not used [-Wunused-but-set-variable]
361 | unsigned short hv_pgsz_idx;
| ^~~~~~~~~~~--- arch/sparc/mm/init_64.c | 6 ------ 1 file changed, 6 deletions(-)
arch/sparc/mm/init_64.c +0 -6
@@ -358,30 +358,24 @@ static void __init pud_huge_patch(void)bool __init arch_hugetlb_valid_size (unsigned long size) {unsigned int hugepage_shift =ilog2 (size); -unsigned short hv_pgsz_idx;unsigned int hv_pgsz_mask;switch (hugepage_shift) {case HPAGE_16GB_SHIFT : hv_pgsz_mask =HV_PGSZ_MASK_16GB ; - hv_pgsz_idx =HV_PGSZ_IDX_16GB ;pud_huge_patch ();break ;case HPAGE_2GB_SHIFT : hv_pgsz_mask =HV_PGSZ_MASK_2GB ; - hv_pgsz_idx =HV_PGSZ_IDX_2GB ;break ;case HPAGE_256MB_SHIFT : hv_pgsz_mask =HV_PGSZ_MASK_256MB ; - hv_pgsz_idx =HV_PGSZ_IDX_256MB ;break ;case HPAGE_SHIFT : hv_pgsz_mask =HV_PGSZ_MASK_4MB ; - hv_pgsz_idx =HV_PGSZ_IDX_4MB ;break ;case HPAGE_64K_SHIFT : hv_pgsz_mask =HV_PGSZ_MASK_64K ; - hv_pgsz_idx =HV_PGSZ_IDX_64K ;break ;default : hv_pgsz_mask =0 ;
Signature · 1 line
2.43.0
Hi Alex,
Quoted 49 lines · On Wed, 2026-01-07 at 14:42 +0800, [email protected] wrote:
From: Alex Shi <[email protected]>
arch/sparc/mm/init_64.c: In function 'arch_hugetlb_valid_size':arch/sparc/mm/init_64.c:361:24: warning: variable 'hv_pgsz_idx' set but not used [-Wunused-but-set-variable] 361 | unsigned short hv_pgsz_idx; | ^~~~~~~~~~~Reported-by kernel test robot <[email protected]>Signed-off-by Alex Shi <[email protected]>Cc Matthew Wilcox <[email protected]>Cc Lorenzo Stoakes <[email protected]>Cc Qi Zheng <[email protected]>Cc Dave Hansen <[email protected]>Cc Zi Yan <[email protected]>Cc Kevin Brodsky <[email protected]>Cc Mike Rapoport <[email protected]>Cc Andrew Morton <[email protected]>Cc Andreas Larsson <[email protected]>Cc David S. Miller <[email protected]>--- arch/sparc/mm/init_64.c | 6 ------ 1 file changed, 6 deletions(-)arch/sparc/mm/init_64.c +0
-4@@ -358,30 +358,24 @@ static void __init pud_huge_patch(void)bool __init arch_hugetlb_valid_size (unsigned long size) {unsigned int hugepage_shift =ilog2 (size); -unsigned short hv_pgsz_idx;unsigned int hv_pgsz_mask;switch (hugepage_shift) {case HPAGE_16GB_SHIFT : hv_pgsz_mask =HV_PGSZ_MASK_16GB ; - hv_pgsz_idx =HV_PGSZ_IDX_16GB ;pud_huge_patch ();break ;case HPAGE_2GB_SHIFT : hv_pgsz_mask =HV_PGSZ_MASK_2GB ; - hv_pgsz_idx =HV_PGSZ_IDX_2GB ;break ;case HPAGE_256MB_SHIFT : hv_pgsz_mask =HV_PGSZ_MASK_256MB ; - hv_pgsz_idx =HV_PGSZ_IDX_256MB ;break ;
arch/sparc/mm/init_64.c static void __init pud_huge_patch(void) · line 381
Quoted 10 lines
arch/sparc/mm/init_64.c +0
-2case HPAGE_SHIFT : hv_pgsz_mask =HV_PGSZ_MASK_4MB ; - hv_pgsz_idx =HV_PGSZ_IDX_4MB ;break ;case HPAGE_64K_SHIFT : hv_pgsz_mask =HV_PGSZ_MASK_64K ; - hv_pgsz_idx =HV_PGSZ_IDX_64K ;break ;default : hv_pgsz_mask =0 ;
Thanks for the patch! Could you fix the typo in the subject?
Thanks,
Adrian
Signature · 4 lines
.''`. John Paul Adrian Glaubitz : :' : Debian Developer `. `' Physicist `- GPG: 62FF 8A75 84E0 2956 9546 0006 7426 3B37 F5B5 F913
Quoted 55 lines · John Paul Adrian Glaubitz
Hi Alex,
Quoted 52 lines · On Wed, 2026-01-07 at 14:42 +0800,[email protected] wrote:
From: Alex Shi<[email protected]>
arch/sparc/mm/init_64.c: In function 'arch_hugetlb_valid_size':
arch/sparc/mm/init_64.c:361:24: warning: variable 'hv_pgsz_idx' set but not used [-Wunused-but-set-variable]
361 | unsigned shorthv_pgsz_idx;
| ^~~~~~~~~~~Reported-by kernel test robot<[email protected]>Signed-off-by Alex Shi<[email protected]>Cc Matthew Wilcox<[email protected]>Cc Lorenzo Stoakes<[email protected]>Cc Qi Zheng<[email protected]>Cc Dave Hansen<[email protected]>Cc Zi Yan<[email protected]>Cc Kevin Brodsky<[email protected]>Cc Mike Rapoport<[email protected]>Cc Andrew Morton<[email protected]>Cc Andreas Larsson<[email protected]>Cc David S. Miller<[email protected]>--- arch/sparc/mm/init_64.c | 6 ------ 1 file changed, 6 deletions(-)arch/sparc/mm/init_64.c +0
-5@@ -358,30 +358,24 @@ static void __init pud_huge_patch(void)bool __init arch_hugetlb_valid_size (unsigned long size) {unsigned int hugepage_shift =ilog2 (size); -unsigned short hv_pgsz_idx;unsigned int hv_pgsz_mask;switch (hugepage_shift) {case HPAGE_16GB_SHIFT : hv_pgsz_mask =HV_PGSZ_MASK_16GB ; - hv_pgsz_idx =HV_PGSZ_IDX_16GB ;pud_huge_patch ();break ;case HPAGE_2GB_SHIFT : hv_pgsz_mask =HV_PGSZ_MASK_2GB ; - hv_pgsz_idx =HV_PGSZ_IDX_2GB ;break ;case HPAGE_256MB_SHIFT : hv_pgsz_mask =HV_PGSZ_MASK_256MB ; - hv_pgsz_idx =HV_PGSZ_IDX_256MB ;break ;case HPAGE_SHIFT : hv_pgsz_mask =HV_PGSZ_MASK_4MB ; - hv_pgsz_idx =HV_PGSZ_IDX_4MB ;
Quoted 8 lines
arch/sparc/mm/init_64.c static void __init pud_huge_patch(void) · line 381
Quoted 7 lines
arch/sparc/mm/init_64.c +0
-1break ;case HPAGE_64K_SHIFT : hv_pgsz_mask =HV_PGSZ_MASK_64K ; - hv_pgsz_idx =HV_PGSZ_IDX_64K ;break ;default : hv_pgsz_mask =0 ;Thanks for the patch! Could you fix the typo in the subject?
Thanks a lot. I will update the subject and resend for v2.
Thanks
Alex
Quoted 7 lines
Thanks,
Adrian-- .''
. John Paul Adrian Glaubitz : :' : Debian Developer.' Physicist- GPG: 62FF 8A75 84E0 2956 9546 0006 7426 3B37 F5B5 F913