raid6: fix riscv symbol undeclared warnigns
PATCH 1/1 raid6: fix riscv symbol undeclared warnigns
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?
--- lib/raid/raid6/riscv/rvv.c | 1 + 1 file changed, 1 insertion(+)
lib/raid/raid6/riscv/rvv.c +1 -0
@@ -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"
Signature · 1 line
2.37.2.352.g3c44437643
[email protected]
AI reviewThank 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…
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 <[email protected]>
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.
Quoted 1 line
raid6: fix riscv symbol undeclared warnigns
This isn't a bug, but there's a typo (warnigns) in the subject line.
lib/raid/raid6/riscv/rvv.c line 13
Quoted 9 lines
lib/raid/raid6/riscv/rvv.c +1
-0@@ -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?
Quoted 3 lines
lib/raid/raid6/riscv/rvv.c +0
-0#ifdef __riscv_vector#error "This code must be built without compiler support for vector"
Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=1
Quoted 10 lines · Ben Dooks
The riscv
rvv.cfile is missing the include ofpq_arch.hwhich 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 <[email protected]>
Paul Walmsley
maintainerQuoted 10 lines · Ben Dooks
The riscv
rvv.cfile is missing the include ofpq_arch.hwhich 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 <[email protected]>
Thanks, queued for v7.2-rc.
- Paul