mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] riscv: Fix sparse warning in vendor_extensions/sifive.c
@ 2025-06-20 12:08 Alexandre Ghiti
  2025-06-24  0:50 ` patchwork-bot+linux-riscv
  2025-06-24  2:20 ` Cyan Yang
  0 siblings, 2 replies; 4+ messages in thread
From: Alexandre Ghiti @ 2025-06-20 12:08 UTC (permalink / raw)
  To: Paul Walmsley, Samuel Holland, Palmer Dabbelt, Albert Ou,
	Alexandre Ghiti, Cyan Yang
  Cc: Palmer Dabbelt, linux-riscv, linux-kernel, kernel test robot,
	Alexandre Ghiti

sparse reports the following warning:

arch/riscv/kernel/vendor_extensions/sifive.c:11:33: sparse: sparse: symbol 'riscv_isa_vendor_ext_sifive' was not declared. Should it be static?

So as this struct is only used in this file, make it static.

Fixes: 2d147d77ae6e ("riscv: Add SiFive xsfvqmaccdod and xsfvqmaccqoq vendor extensions")
Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202505072100.TZlEp8h1-lkp@intel.com/
Signed-off-by: Alexandre Ghiti <alexghiti@rivosinc.com>
---
 arch/riscv/kernel/vendor_extensions/sifive.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/riscv/kernel/vendor_extensions/sifive.c b/arch/riscv/kernel/vendor_extensions/sifive.c
index 1411337dc1e61aba0b844902f356625048c85abc..8fcf67e8c07facd1bfdbc0e18dd9b43102f22145 100644
--- a/arch/riscv/kernel/vendor_extensions/sifive.c
+++ b/arch/riscv/kernel/vendor_extensions/sifive.c
@@ -8,7 +8,7 @@
 #include <linux/types.h>
 
 /* All SiFive vendor extensions supported in Linux */
-const struct riscv_isa_ext_data riscv_isa_vendor_ext_sifive[] = {
+static const struct riscv_isa_ext_data riscv_isa_vendor_ext_sifive[] = {
 	__RISCV_ISA_EXT_DATA(xsfvfnrclipxfqf, RISCV_ISA_VENDOR_EXT_XSFVFNRCLIPXFQF),
 	__RISCV_ISA_EXT_DATA(xsfvfwmaccqqq, RISCV_ISA_VENDOR_EXT_XSFVFWMACCQQQ),
 	__RISCV_ISA_EXT_DATA(xsfvqmaccdod, RISCV_ISA_VENDOR_EXT_XSFVQMACCDOD),

---
base-commit: e10a0dc2d21fd742c8d6ba042a98c05815011f9d
change-id: 20250620-dev-alex-fix_sparse_sifive_v1-4e130e7e2833

Best regards,
-- 
Alexandre Ghiti <alexghiti@rivosinc.com>


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] riscv: Fix sparse warning in vendor_extensions/sifive.c
  2025-06-20 12:08 [PATCH] riscv: Fix sparse warning in vendor_extensions/sifive.c Alexandre Ghiti
@ 2025-06-24  0:50 ` patchwork-bot+linux-riscv
  2025-06-24  2:20 ` Cyan Yang
  1 sibling, 0 replies; 4+ messages in thread
From: patchwork-bot+linux-riscv @ 2025-06-24  0:50 UTC (permalink / raw)
  To: Alexandre Ghiti
  Cc: linux-riscv, paul.walmsley, samuel.holland, palmer, aou, alex,
	cyan.yang, palmer, linux-kernel, lkp

Hello:

This patch was applied to riscv/linux.git (fixes)
by Palmer Dabbelt <palmer@dabbelt.com>:

On Fri, 20 Jun 2025 12:08:11 +0000 you wrote:
> sparse reports the following warning:
> 
> arch/riscv/kernel/vendor_extensions/sifive.c:11:33: sparse: sparse: symbol 'riscv_isa_vendor_ext_sifive' was not declared. Should it be static?
> 
> So as this struct is only used in this file, make it static.
> 
> Fixes: 2d147d77ae6e ("riscv: Add SiFive xsfvqmaccdod and xsfvqmaccqoq vendor extensions")
> Reported-by: kernel test robot <lkp@intel.com>
> Closes: https://lore.kernel.org/oe-kbuild-all/202505072100.TZlEp8h1-lkp@intel.com/
> Signed-off-by: Alexandre Ghiti <alexghiti@rivosinc.com>
> 
> [...]

Here is the summary with links:
  - riscv: Fix sparse warning in vendor_extensions/sifive.c
    https://git.kernel.org/riscv/c/b0843f836126

You are awesome, thank you!
-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] riscv: Fix sparse warning in vendor_extensions/sifive.c
  2025-06-20 12:08 [PATCH] riscv: Fix sparse warning in vendor_extensions/sifive.c Alexandre Ghiti
  2025-06-24  0:50 ` patchwork-bot+linux-riscv
@ 2025-06-24  2:20 ` Cyan Yang
  2025-06-24  6:50   ` Alexandre Ghiti
  1 sibling, 1 reply; 4+ messages in thread
From: Cyan Yang @ 2025-06-24  2:20 UTC (permalink / raw)
  To: Alexandre Ghiti
  Cc: Paul Walmsley, Samuel Holland, Palmer Dabbelt, Albert Ou,
	Alexandre Ghiti, Palmer Dabbelt, linux-riscv, linux-kernel,
	kernel test robot

Hi Alexandre,

Sorry that I missed this patch. 

I believe there is already the v2 version to fix this warning at 
https://lore.kernel.org/lkml/20250516030310.16950-1-cyan.yang@sifive.com/

Regards,
Cyan

On Fri, Jun 20, 2025 at 12:08:11PM +0000, Alexandre Ghiti wrote:
> sparse reports the following warning:
> 
> arch/riscv/kernel/vendor_extensions/sifive.c:11:33: sparse: sparse: symbol 'riscv_isa_vendor_ext_sifive' was not declared. Should it be static?
> 
> So as this struct is only used in this file, make it static.
> 
> Fixes: 2d147d77ae6e ("riscv: Add SiFive xsfvqmaccdod and xsfvqmaccqoq vendor extensions")
> Reported-by: kernel test robot <lkp@intel.com>
> Closes: https://lore.kernel.org/oe-kbuild-all/202505072100.TZlEp8h1-lkp@intel.com/
> Signed-off-by: Alexandre Ghiti <alexghiti@rivosinc.com>
> ---
>  arch/riscv/kernel/vendor_extensions/sifive.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/arch/riscv/kernel/vendor_extensions/sifive.c b/arch/riscv/kernel/vendor_extensions/sifive.c
> index 1411337dc1e61aba0b844902f356625048c85abc..8fcf67e8c07facd1bfdbc0e18dd9b43102f22145 100644
> --- a/arch/riscv/kernel/vendor_extensions/sifive.c
> +++ b/arch/riscv/kernel/vendor_extensions/sifive.c
> @@ -8,7 +8,7 @@
>  #include <linux/types.h>
>  
>  /* All SiFive vendor extensions supported in Linux */
> -const struct riscv_isa_ext_data riscv_isa_vendor_ext_sifive[] = {
> +static const struct riscv_isa_ext_data riscv_isa_vendor_ext_sifive[] = {
>  	__RISCV_ISA_EXT_DATA(xsfvfnrclipxfqf, RISCV_ISA_VENDOR_EXT_XSFVFNRCLIPXFQF),
>  	__RISCV_ISA_EXT_DATA(xsfvfwmaccqqq, RISCV_ISA_VENDOR_EXT_XSFVFWMACCQQQ),
>  	__RISCV_ISA_EXT_DATA(xsfvqmaccdod, RISCV_ISA_VENDOR_EXT_XSFVQMACCDOD),
> 
> ---
> base-commit: e10a0dc2d21fd742c8d6ba042a98c05815011f9d
> change-id: 20250620-dev-alex-fix_sparse_sifive_v1-4e130e7e2833
> 
> Best regards,
> -- 
> Alexandre Ghiti <alexghiti@rivosinc.com>
> 

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] riscv: Fix sparse warning in vendor_extensions/sifive.c
  2025-06-24  2:20 ` Cyan Yang
@ 2025-06-24  6:50   ` Alexandre Ghiti
  0 siblings, 0 replies; 4+ messages in thread
From: Alexandre Ghiti @ 2025-06-24  6:50 UTC (permalink / raw)
  To: Cyan Yang
  Cc: Paul Walmsley, Samuel Holland, Palmer Dabbelt, Albert Ou,
	Alexandre Ghiti, Palmer Dabbelt, linux-riscv, linux-kernel,
	kernel test robot

Hi Cyan,

On Tue, Jun 24, 2025 at 4:20 AM Cyan Yang <cyan.yang@sifive.com> wrote:
>
> Hi Alexandre,
>
> Sorry that I missed this patch.
>
> I believe there is already the v2 version to fix this warning at
> https://lore.kernel.org/lkml/20250516030310.16950-1-cyan.yang@sifive.com/

Yes but v1 got merged instead, hence the separate fix.

Thanks,

Alex

>
> Regards,
> Cyan
>
> On Fri, Jun 20, 2025 at 12:08:11PM +0000, Alexandre Ghiti wrote:
> > sparse reports the following warning:
> >
> > arch/riscv/kernel/vendor_extensions/sifive.c:11:33: sparse: sparse: symbol 'riscv_isa_vendor_ext_sifive' was not declared. Should it be static?
> >
> > So as this struct is only used in this file, make it static.
> >
> > Fixes: 2d147d77ae6e ("riscv: Add SiFive xsfvqmaccdod and xsfvqmaccqoq vendor extensions")
> > Reported-by: kernel test robot <lkp@intel.com>
> > Closes: https://lore.kernel.org/oe-kbuild-all/202505072100.TZlEp8h1-lkp@intel.com/
> > Signed-off-by: Alexandre Ghiti <alexghiti@rivosinc.com>
> > ---
> >  arch/riscv/kernel/vendor_extensions/sifive.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/arch/riscv/kernel/vendor_extensions/sifive.c b/arch/riscv/kernel/vendor_extensions/sifive.c
> > index 1411337dc1e61aba0b844902f356625048c85abc..8fcf67e8c07facd1bfdbc0e18dd9b43102f22145 100644
> > --- a/arch/riscv/kernel/vendor_extensions/sifive.c
> > +++ b/arch/riscv/kernel/vendor_extensions/sifive.c
> > @@ -8,7 +8,7 @@
> >  #include <linux/types.h>
> >
> >  /* All SiFive vendor extensions supported in Linux */
> > -const struct riscv_isa_ext_data riscv_isa_vendor_ext_sifive[] = {
> > +static const struct riscv_isa_ext_data riscv_isa_vendor_ext_sifive[] = {
> >       __RISCV_ISA_EXT_DATA(xsfvfnrclipxfqf, RISCV_ISA_VENDOR_EXT_XSFVFNRCLIPXFQF),
> >       __RISCV_ISA_EXT_DATA(xsfvfwmaccqqq, RISCV_ISA_VENDOR_EXT_XSFVFWMACCQQQ),
> >       __RISCV_ISA_EXT_DATA(xsfvqmaccdod, RISCV_ISA_VENDOR_EXT_XSFVQMACCDOD),
> >
> > ---
> > base-commit: e10a0dc2d21fd742c8d6ba042a98c05815011f9d
> > change-id: 20250620-dev-alex-fix_sparse_sifive_v1-4e130e7e2833
> >
> > Best regards,
> > --
> > Alexandre Ghiti <alexghiti@rivosinc.com>
> >

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2025-06-24  6:50 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-06-20 12:08 [PATCH] riscv: Fix sparse warning in vendor_extensions/sifive.c Alexandre Ghiti
2025-06-24  0:50 ` patchwork-bot+linux-riscv
2025-06-24  2:20 ` Cyan Yang
2025-06-24  6:50   ` Alexandre Ghiti

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®