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.
> 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/[email protected]?part=1
lmpx.com only provides a reader for public news (NNTP) servers. It is not
affiliated with the servers or forums shown here and is not responsible for
the content of articles, which is written by their respective authors.