* [PATCH v2] arch/sparc: fix unused variable warning
@ 2026-01-07 10:41 alexs
2026-01-07 14:46 ` Matthew Wilcox
2026-01-26 16:43 ` Andreas Larsson
0 siblings, 2 replies; 7+ messages in thread
From: alexs @ 2026-01-07 10:41 UTC (permalink / raw)
To: David S. Miller, Andreas Larsson,
open list:SPARC + UltraSPARC (sparc/sparc64), open list
Cc: Alex Shi, kernel test robot, sparclinux, Matthew Wilcox,
Lorenzo Stoakes, Qi Zheng, Dave Hansen, Zi Yan, Kevin Brodsky,
Mike Rapoport, Andrew Morton
From: Alex Shi <alexs@kernel.org>
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 <lkp@intel.com>
Signed-off-by: Alex Shi <alexs@kernel.org>
Cc: sparclinux@vger.kernel.org
Cc: Matthew Wilcox <willy@infradead.org>
Cc: Lorenzo Stoakes <lorenzo.stoakes@oracle.com>
Cc: Qi Zheng <zhengqi.arch@bytedance.com>
Cc: Dave Hansen <dave.hansen@linux.intel.com>
Cc: Zi Yan <ziy@nvidia.com>
Cc: Kevin Brodsky <kevin.brodsky@arm.com>
Cc: Mike Rapoport <rppt@kernel.org>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Andreas Larsson <andreas@gaisler.com>
Cc: David S. Miller <davem@davemloft.net>
---
arch/sparc/mm/init_64.c | 6 ------
1 file changed, 6 deletions(-)
diff --git a/arch/sparc/mm/init_64.c b/arch/sparc/mm/init_64.c
index df9f7c444c39..ba19d23d4040 100644
--- a/arch/sparc/mm/init_64.c
+++ b/arch/sparc/mm/init_64.c
@@ -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;
--
2.43.0
^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [PATCH v2] arch/sparc: fix unused variable warning
2026-01-07 10:41 [PATCH v2] arch/sparc: fix unused variable warning alexs
@ 2026-01-07 14:46 ` Matthew Wilcox
2026-01-08 1:26 ` Alex Shi
2026-01-08 2:30 ` Alex Shi
2026-01-26 16:43 ` Andreas Larsson
1 sibling, 2 replies; 7+ messages in thread
From: Matthew Wilcox @ 2026-01-07 14:46 UTC (permalink / raw)
To: alexs
Cc: David S. Miller, Andreas Larsson,
open list:SPARC + UltraSPARC (sparc/sparc64), open list,
kernel test robot, Lorenzo Stoakes, Qi Zheng, Dave Hansen, Zi Yan,
Kevin Brodsky, Mike Rapoport, Andrew Morton
On Wed, Jan 07, 2026 at 06:41:44PM +0800, alexs@kernel.org wrote:
> From: Alex Shi <alexs@kernel.org>
>
> 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;
> | ^~~~~~~~~~~
Looks like it's been unused since introduction in c7d9f77d33a7 ?
As such, why cc all these people who have absolutely nothing to do with
it? Use your brain, not a stupid script.
> Reported-by: kernel test robot <lkp@intel.com>
> Signed-off-by: Alex Shi <alexs@kernel.org>
> Cc: sparclinux@vger.kernel.org
> Cc: Matthew Wilcox <willy@infradead.org>
> Cc: Lorenzo Stoakes <lorenzo.stoakes@oracle.com>
> Cc: Qi Zheng <zhengqi.arch@bytedance.com>
> Cc: Dave Hansen <dave.hansen@linux.intel.com>
> Cc: Zi Yan <ziy@nvidia.com>
> Cc: Kevin Brodsky <kevin.brodsky@arm.com>
> Cc: Mike Rapoport <rppt@kernel.org>
> Cc: Andrew Morton <akpm@linux-foundation.org>
> Cc: Andreas Larsson <andreas@gaisler.com>
> Cc: David S. Miller <davem@davemloft.net>
> ---
> arch/sparc/mm/init_64.c | 6 ------
> 1 file changed, 6 deletions(-)
>
> diff --git a/arch/sparc/mm/init_64.c b/arch/sparc/mm/init_64.c
> index df9f7c444c39..ba19d23d4040 100644
> --- a/arch/sparc/mm/init_64.c
> +++ b/arch/sparc/mm/init_64.c
> @@ -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;
> --
> 2.43.0
>
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH v2] arch/sparc: fix unused variable warning
2026-01-07 14:46 ` Matthew Wilcox
@ 2026-01-08 1:26 ` Alex Shi
2026-01-08 2:30 ` Alex Shi
1 sibling, 0 replies; 7+ messages in thread
From: Alex Shi @ 2026-01-08 1:26 UTC (permalink / raw)
To: Matthew Wilcox, alexs
Cc: David S. Miller, Andreas Larsson,
open list:SPARC + UltraSPARC (sparc/sparc64), open list,
kernel test robot, Lorenzo Stoakes, Qi Zheng, Dave Hansen, Zi Yan,
Kevin Brodsky, Mike Rapoport, Andrew Morton
On 2026/1/7 22:46, Matthew Wilcox wrote:
> On Wed, Jan 07, 2026 at 06:41:44PM +0800,alexs@kernel.org wrote:
>> From: Alex Shi<alexs@kernel.org>
>>
>> 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;
>> | ^~~~~~~~~~~
> Looks like it's been unused since introduction in c7d9f77d33a7 ?
>
> As such, why cc all these people who have absolutely nothing to do with
> it? Use your brain, not a stupid script.
Thanks for the feedback, Matthew. You're right—the script was too
aggressive for such a localized fix.
I used 'scripts/get_maintainer.pl' without enough manual filtering.
Besides '--nogit-fallback', are there specific parameters or workflows
you recommend to keep the CC list lean for trivial cleanups like this?
I'll be more surgical with the CC list on the next version.
Thanks!
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH v2] arch/sparc: fix unused variable warning
2026-01-07 14:46 ` Matthew Wilcox
2026-01-08 1:26 ` Alex Shi
@ 2026-01-08 2:30 ` Alex Shi
1 sibling, 0 replies; 7+ messages in thread
From: Alex Shi @ 2026-01-08 2:30 UTC (permalink / raw)
To: Matthew Wilcox, alexs
Cc: David S. Miller, Andreas Larsson,
open list:SPARC + UltraSPARC (sparc/sparc64), open list,
kernel test robot, Lorenzo Stoakes, Qi Zheng, Dave Hansen, Zi Yan,
Kevin Brodsky, Mike Rapoport, Andrew Morton
On 2026/1/7 22:46, Matthew Wilcox wrote:
> On Wed, Jan 07, 2026 at 06:41:44PM +0800,alexs@kernel.org wrote:
>> From: Alex Shi<alexs@kernel.org>
>>
>> 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;
>> | ^~~~~~~~~~~
> Looks like it's been unused since introduction in c7d9f77d33a7 ?
>
> As such, why cc all these people who have absolutely nothing to do with
> it? Use your brain, not a stupid script.
Thanks for the feedback, Matthew. You're right—the script was too
aggressive for such a localized fix.
I used scripts/get_maintainer.pl without enough manual filtering. Are
there specific parameters or workflows you recommend to keep the CC list
lean for trivial cleanups like this?
I'll be more surgical with the CC list on the next version.
Thanks
Alex
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH v2] arch/sparc: fix unused variable warning
2026-01-07 10:41 [PATCH v2] arch/sparc: fix unused variable warning alexs
2026-01-07 14:46 ` Matthew Wilcox
@ 2026-01-26 16:43 ` Andreas Larsson
2026-01-26 16:58 ` Andreas Larsson
2026-02-02 6:56 ` Alex Shi
1 sibling, 2 replies; 7+ messages in thread
From: Andreas Larsson @ 2026-01-26 16:43 UTC (permalink / raw)
To: alexs, David S. Miller,
open list:SPARC + UltraSPARC (sparc/sparc64), open list
Cc: kernel test robot, Matthew Wilcox, Lorenzo Stoakes, Qi Zheng,
Dave Hansen, Zi Yan, Kevin Brodsky, Mike Rapoport, Andrew Morton
On 2026-01-07 11:41, alexs@kernel.org wrote:
> From: Alex Shi <alexs@kernel.org>
>
> 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 <lkp@intel.com>
Did the kernel test robot also suggest a "Closes:" line as well? If so,
please also add that.
> Signed-off-by: Alex Shi <alexs@kernel.org>
> Cc: sparclinux@vger.kernel.org
> Cc: Matthew Wilcox <willy@infradead.org>
> Cc: Lorenzo Stoakes <lorenzo.stoakes@oracle.com>
> Cc: Qi Zheng <zhengqi.arch@bytedance.com>
> Cc: Dave Hansen <dave.hansen@linux.intel.com>
> Cc: Zi Yan <ziy@nvidia.com>
> Cc: Kevin Brodsky <kevin.brodsky@arm.com>
> Cc: Mike Rapoport <rppt@kernel.org>
> Cc: Andrew Morton <akpm@linux-foundation.org>
> Cc: Andreas Larsson <andreas@gaisler.com>
> Cc: David S. Miller <davem@davemloft.net>
> ---
It's helpful if you put changes between versions in between --- lines
here.
> arch/sparc/mm/init_64.c | 6 ------
> 1 file changed, 6 deletions(-)
>
> diff --git a/arch/sparc/mm/init_64.c b/arch/sparc/mm/init_64.c
> index df9f7c444c39..ba19d23d4040 100644
> --- a/arch/sparc/mm/init_64.c
> +++ b/arch/sparc/mm/init_64.c
> @@ -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;
Other than the potentially missing Closes: line, LGTM.
Thanks,
Andreas
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH v2] arch/sparc: fix unused variable warning
2026-01-26 16:43 ` Andreas Larsson
@ 2026-01-26 16:58 ` Andreas Larsson
2026-02-02 6:56 ` Alex Shi
1 sibling, 0 replies; 7+ messages in thread
From: Andreas Larsson @ 2026-01-26 16:58 UTC (permalink / raw)
To: alexs, David S. Miller,
open list:SPARC + UltraSPARC (sparc/sparc64), open list
Cc: kernel test robot, Matthew Wilcox, Lorenzo Stoakes, Qi Zheng,
Dave Hansen, Zi Yan, Kevin Brodsky, Mike Rapoport, Andrew Morton
> Other than the potentially missing Closes: line, LGTM.
Oh, and also, please use "sparc64:" instead of "arch/sparc:" in the
subject. No need for "arch/" and this change is only for sparc64.
Thanks,
Andreas
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH v2] arch/sparc: fix unused variable warning
2026-01-26 16:43 ` Andreas Larsson
2026-01-26 16:58 ` Andreas Larsson
@ 2026-02-02 6:56 ` Alex Shi
1 sibling, 0 replies; 7+ messages in thread
From: Alex Shi @ 2026-02-02 6:56 UTC (permalink / raw)
To: Andreas Larsson
Cc: alexs, David S. Miller,
open list:SPARC + UltraSPARC (sparc/sparc64), open list,
kernel test robot
Andreas Larsson <andreas@gaisler.com> 于2026年1月27日周二 00:44写道:
>
> On 2026-01-07 11:41, alexs@kernel.org wrote:
> > From: Alex Shi <alexs@kernel.org>
> >
> > 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 <lkp@intel.com>
>
> Did the kernel test robot also suggest a "Closes:" line as well? If so,
> please also add that.
No, I found this issue in a lkp report for my testing code on sparc.
In that report, lkp just focus on my another issue.
>
> > Signed-off-by: Alex Shi <alexs@kernel.org>
> > Cc: sparclinux@vger.kernel.org
> > Cc: Matthew Wilcox <willy@infradead.org>
> > Cc: Lorenzo Stoakes <lorenzo.stoakes@oracle.com>
> > Cc: Qi Zheng <zhengqi.arch@bytedance.com>
> > Cc: Dave Hansen <dave.hansen@linux.intel.com>
> > Cc: Zi Yan <ziy@nvidia.com>
> > Cc: Kevin Brodsky <kevin.brodsky@arm.com>
> > Cc: Mike Rapoport <rppt@kernel.org>
> > Cc: Andrew Morton <akpm@linux-foundation.org>
> > Cc: Andreas Larsson <andreas@gaisler.com>
> > Cc: David S. Miller <davem@davemloft.net>
> > ---
>
> It's helpful if you put changes between versions in between --- lines
> here.
Thanks for suggestion, will do it in next version.
Thanks
Alex
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2026-02-02 6:57 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-01-07 10:41 [PATCH v2] arch/sparc: fix unused variable warning alexs
2026-01-07 14:46 ` Matthew Wilcox
2026-01-08 1:26 ` Alex Shi
2026-01-08 2:30 ` Alex Shi
2026-01-26 16:43 ` Andreas Larsson
2026-01-26 16:58 ` Andreas Larsson
2026-02-02 6:56 ` Alex Shi
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox