Linux RAID subsystem development
 help / color / mirror / Atom feed
* [PATCH] raid6: fix riscv symbol undeclared warnigns
@ 2026-06-22 13:52 Ben Dooks
  2026-06-22 14:02 ` sashiko-bot
  0 siblings, 1 reply; 2+ messages in thread
From: Ben Dooks @ 2026-06-22 13:52 UTC (permalink / raw)
  To: linux-raid, Song Liu, Yu Kuai
  Cc: linux-riscv, linux-kernel, Paul Walmsley, Palmer Dabbelt,
	Ben Dooks

The riscv rvv.c file is missing the include of pq_arch.h
which defines all the exported functions. Include this
to remove the following sparse warnings:

lib/raid/raid6/riscv/rvv.c:1225:1: warning: symbol 'raid6_rvvx1' was not declared. Should it be static?
lib/raid/raid6/riscv/rvv.c:1226:1: warning: symbol 'raid6_rvvx2' was not declared. Should it be static?
lib/raid/raid6/riscv/rvv.c:1227:1: warning: symbol 'raid6_rvvx4' was not declared. Should it be static?
lib/raid/raid6/riscv/rvv.c:1228:1: warning: symbol 'raid6_rvvx8' was not declared. Should it be static?

Signed-off-by: Ben Dooks <ben.dooks@codethink.co.uk>
---
 lib/raid/raid6/riscv/rvv.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/lib/raid/raid6/riscv/rvv.c b/lib/raid/raid6/riscv/rvv.c
index 75c9dafedb28..4ac50606f3dc 100644
--- a/lib/raid/raid6/riscv/rvv.c
+++ b/lib/raid/raid6/riscv/rvv.c
@@ -10,6 +10,7 @@
  */
 
 #include "rvv.h"
+#include "pq_arch.h"
 
 #ifdef __riscv_vector
 #error "This code must be built without compiler support for vector"
-- 
2.37.2.352.g3c44437643


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

* Re: [PATCH] raid6: fix riscv symbol undeclared warnigns
  2026-06-22 13:52 [PATCH] raid6: fix riscv symbol undeclared warnigns Ben Dooks
@ 2026-06-22 14:02 ` sashiko-bot
  0 siblings, 0 replies; 2+ messages in thread
From: sashiko-bot @ 2026-06-22 14:02 UTC (permalink / raw)
  To: Ben Dooks; +Cc: yukuai, linux-raid

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Low] Including `pq_arch.h` in `rvv.c` misuses an initialization fragment as a header, creating a brittle include dependency and violating architectural boundaries.
--

commit 0d7480a95df3baf577ec13b2b5aec7d36d11ee3f
Author: Ben Dooks <ben.dooks@codethink.co.uk>

raid6: fix riscv symbol undeclared warnigns

This commit attempts to resolve sparse warnings about undeclared raid6_rvvx
symbols in the RISC-V RAID6 implementation by including pq_arch.h in rvv.c.

> raid6: fix riscv symbol undeclared warnigns

This isn't a bug, but there's a typo (warnigns) in the subject line.

> diff --git a/lib/raid/raid6/riscv/rvv.c b/lib/raid/raid6/riscv/rvv.c
> index 75c9dafedb284..4ac50606f3dc1 100644
> --- a/lib/raid/raid6/riscv/rvv.c
> +++ b/lib/raid/raid6/riscv/rvv.c
> @@ -10,6 +10,7 @@
>   */
>  
>  #include "rvv.h"
> +#include "pq_arch.h"

[Severity: Low]
Is it appropriate to include pq_arch.h here to fix the sparse warnings?

The pq_arch.h file appears to be designed as an initialization fragment meant
to be conditionally included by the generic algos.c, since it contains the
arch_raid6_init() static inline function. Including it here inappropriately
injects unused initialization functions into the backend implementation.

Does this also create a brittle include order dependency? The pq_arch.h file
uses functions like raid6_algo_add_default and raid6_algo_add but does not
include algos.h where they are declared. The build only succeeds because rvv.c
happens to include rvv.h (which includes algos.h) immediately before pq_arch.h.
Any reordering of these includes could break the build.

Would it be safer to place the extern declarations for these symbols in a
shared internal header like rvv.h?

>  
>  #ifdef __riscv_vector
>  #error "This code must be built without compiler support for vector"

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260622135207.480540-1-ben.dooks@codethink.co.uk?part=1

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

end of thread, other threads:[~2026-06-22 14:02 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-06-22 13:52 [PATCH] raid6: fix riscv symbol undeclared warnigns Ben Dooks
2026-06-22 14:02 ` sashiko-bot

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