Re: [PATCH v2] arch/sparc: fix unused variable warning

From: Alex Shi

Date: Mon Feb 02 2026 - 01:57:45 EST


Andreas Larsson <andreas@xxxxxxxxxxx> 于2026年1月27日周二 00:44写道:
>
> On 2026-01-07 11:41, alexs@xxxxxxxxxx wrote:
> > From: Alex Shi <alexs@xxxxxxxxxx>
> >
> > 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@xxxxxxxxx>
>
> 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@xxxxxxxxxx>
> > Cc: sparclinux@xxxxxxxxxxxxxxx
> > Cc: Matthew Wilcox <willy@xxxxxxxxxxxxx>
> > Cc: Lorenzo Stoakes <lorenzo.stoakes@xxxxxxxxxx>
> > Cc: Qi Zheng <zhengqi.arch@xxxxxxxxxxxxx>
> > Cc: Dave Hansen <dave.hansen@xxxxxxxxxxxxxxx>
> > Cc: Zi Yan <ziy@xxxxxxxxxx>
> > Cc: Kevin Brodsky <kevin.brodsky@xxxxxxx>
> > Cc: Mike Rapoport <rppt@xxxxxxxxxx>
> > Cc: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx>
> > Cc: Andreas Larsson <andreas@xxxxxxxxxxx>
> > Cc: David S. Miller <davem@xxxxxxxxxxxxx>
> > ---
>
> It's helpful if you put changes between versions in between --- lines
> here.

Thanks for suggestion, will do it in next version.

Thanks
Alex