raid6: neon: add missing prototypes
PATCH 1/1 raid6: neon: add missing prototypes
From: Arnd Bergmann <[email protected]>
The raid6 syndrome functions are generated for different sizes and have no generic prototype, while in the inner functions have a prototype in a header that cannot be included from the correct file. In both cases, the compiler warns about missing prototypes:
lib/raid6/recov_neon_inner.c:27:6: warning: no previous prototype for '__raid6_2data_recov_neon' [-Wmissing-prototypes] lib/raid6/recov_neon_inner.c:77:6: warning: no previous prototype for '__raid6_datap_recov_neon' [-Wmissing-prototypes] lib/raid6/neon1.c:56:6: warning: no previous prototype for 'raid6_neon1_gen_syndrome_real' [-Wmissing-prototypes] lib/raid6/neon1.c:86:6: warning: no previous prototype for 'raid6_neon1_xor_syndrome_real' [-Wmissing-prototypes] lib/raid6/neon2.c:56:6: warning: no previous prototype for 'raid6_neon2_gen_syndrome_real' [-Wmissing-prototypes] lib/raid6/neon2.c:97:6: warning: no previous prototype for 'raid6_neon2_xor_syndrome_real' [-Wmissing-prototypes] lib/raid6/neon4.c:56:6: warning: no previous prototype for 'raid6_neon4_gen_syndrome_real' [-Wmissing-prototypes] lib/raid6/neon4.c:119:6: warning: no previous prototype for 'raid6_neon4_xor_syndrome_real' [-Wmissing-prototypes] lib/raid6/neon8.c:56:6: warning: no previous prototype for 'raid6_neon8_gen_syndrome_real' [-Wmissing-prototypes] lib/raid6/neon8.c:163:6: warning: no previous prototype for 'raid6_neon8_xor_syndrome_real' [-Wmissing-prototypes]
Add a new header file that contains the prototypes for both to avoid the warnings.
--- lib/raid6/neon.h | 22 ++++++++++++++++++++++ lib/raid6/neon.uc | 1 + lib/raid6/recov_neon.c | 8 +------- lib/raid6/recov_neon_inner.c | 1 + 4 files changed, 25 insertions(+), 7 deletions(-) create mode 100644 lib/raid6/neon.h
lib/raid6/neon.h new file +22 -0
@@ -0,0 +1,22 @@ +// SPDX-License-Identifier: GPL-2.0-only + +void raid6_neon1_gen_syndrome_real (int disks,unsigned long bytes,void **ptrs); +void raid6_neon1_xor_syndrome_real (int disks,int start,int stop, +unsigned long bytes,void **ptrs); +void raid6_neon2_gen_syndrome_real (int disks,unsigned long bytes,void **ptrs); +void raid6_neon2_xor_syndrome_real (int disks,int start,int stop, +unsigned long bytes,void **ptrs); +void raid6_neon4_gen_syndrome_real (int disks,unsigned long bytes,void **ptrs); +void raid6_neon4_xor_syndrome_real (int disks,int start,int stop, +unsigned long bytes,void **ptrs); +void raid6_neon8_gen_syndrome_real (int disks,unsigned long bytes,void **ptrs); +void raid6_neon8_xor_syndrome_real (int disks,int start,int stop, +unsigned long bytes,void **ptrs); +void __raid6_2data_recov_neon (int bytes,uint8_t *p,uint8_t *q,uint8_t *dp, +uint8_t *dq,const uint8_t *pbmul, +const uint8_t *qmul); + +void __raid6_datap_recov_neon (int bytes,uint8_t *p,uint8_t *q,uint8_t *dq, +const uint8_t *qmul); + +
lib/raid6/neon.uc +1 -0
@@ -25,6 +25,7 @@ */ #include <arm_neon.h> +#include "neon.h" typedef uint8x16_t unative_t;
lib/raid6/recov_neon.c +1 -7
@@ -8,6 +8,7 @@#ifdef __KERNEL__#include <asm/neon.h> +#include "neon.h" #else #define kernel_neon_begin ()#define kernel_neon_end ()
@@ -19,13 +20,6 @@ static int raid6_has_neon(void)return cpu_has_neon (); } -void __raid6_2data_recov_neon (int bytes,uint8_t *p,uint8_t *q,uint8_t *dp, -uint8_t *dq,const uint8_t *pbmul, -const uint8_t *qmul); - -void __raid6_datap_recov_neon (int bytes,uint8_t *p,uint8_t *q,uint8_t *dq, -const uint8_t *qmul); -static void raid6_2data_recov_neon (int disks,size_t bytes,int faila,int failb,void **ptrs) {
lib/raid6/recov_neon_inner.c +1 -0
@@ -5,6 +5,7 @@*/ #include <arm_neon.h> +#include "neon.h" #ifdef CONFIG_ARM /*
Signature · 1 line
2.39.2
Quoted 19 lines · Arnd Bergmann
From: Arnd Bergmann <[email protected]>
The raid6 syndrome functions are generated for different sizes and have no generic prototype, while in the inner functions have a prototype in a header that cannot be included from the correct file. In both cases, the compiler warns about missing prototypes:
lib/raid6/recov_neon_inner.c:27:6: warning: no previous prototype for '__raid6_2data_recov_neon' [-Wmissing-prototypes]lib/raid6/recov_neon_inner.c:77:6: warning: no previous prototype for '__raid6_datap_recov_neon' [-Wmissing-prototypes]lib/raid6/neon1.c:56:6: warning: no previous prototype for 'raid6_neon1_gen_syndrome_real' [-Wmissing-prototypes]lib/raid6/neon1.c:86:6: warning: no previous prototype for 'raid6_neon1_xor_syndrome_real' [-Wmissing-prototypes]lib/raid6/neon2.c:56:6: warning: no previous prototype for 'raid6_neon2_gen_syndrome_real' [-Wmissing-prototypes]lib/raid6/neon2.c:97:6: warning: no previous prototype for 'raid6_neon2_xor_syndrome_real' [-Wmissing-prototypes]lib/raid6/neon4.c:56:6: warning: no previous prototype for 'raid6_neon4_gen_syndrome_real' [-Wmissing-prototypes]lib/raid6/neon4.c:119:6: warning: no previous prototype for 'raid6_neon4_xor_syndrome_real' [-Wmissing-prototypes]lib/raid6/neon8.c:56:6: warning: no previous prototype for 'raid6_neon8_gen_syndrome_real' [-Wmissing-prototypes]lib/raid6/neon8.c:163:6: warning: no previous prototype for 'raid6_neon8_xor_syndrome_real' [-Wmissing-prototypes]
Quoted 4 lines
Add a new header file that contains the prototypes for both to avoid the warnings.
Signed-off-by Arnd Bergmann <[email protected]>
Applied to md-next. Thanks!
Song
Quoted 89 lines
--- lib/raid6/neon.h | 22 ++++++++++++++++++++++ lib/raid6/neon.uc | 1 + lib/raid6/recov_neon.c | 8 +------- lib/raid6/recov_neon_inner.c | 1 + 4 files changed, 25 insertions(+), 7 deletions(-) create mode 100644 lib/raid6/neon.hlib/raid6/neon.h new file +22
-0@@ -0,0 +1,22 @@ +// SPDX-License-Identifier: GPL-2.0-only + +void raid6_neon1_gen_syndrome_real (int disks,unsigned long bytes,void **ptrs); +void raid6_neon1_xor_syndrome_real (int disks,int start,int stop, +unsigned long bytes,void **ptrs); +void raid6_neon2_gen_syndrome_real (int disks,unsigned long bytes,void **ptrs); +void raid6_neon2_xor_syndrome_real (int disks,int start,int stop, +unsigned long bytes,void **ptrs); +void raid6_neon4_gen_syndrome_real (int disks,unsigned long bytes,void **ptrs); +void raid6_neon4_xor_syndrome_real (int disks,int start,int stop, +unsigned long bytes,void **ptrs); +void raid6_neon8_gen_syndrome_real (int disks,unsigned long bytes,void **ptrs); +void raid6_neon8_xor_syndrome_real (int disks,int start,int stop, +unsigned long bytes,void **ptrs); +void __raid6_2data_recov_neon (int bytes,uint8_t *p,uint8_t *q,uint8_t *dp, +uint8_t *dq,const uint8_t *pbmul, +const uint8_t *qmul); + +void __raid6_datap_recov_neon (int bytes,uint8_t *p,uint8_t *q,uint8_t *dq, +const uint8_t *qmul); + +lib/raid6/neon.uc +1
-0@@ -25,6 +25,7 @@ */ #include <arm_neon.h> +#include "neon.h" typedef uint8x16_t unative_t;lib/raid6/recov_neon.c +1
-7@@ -8,6 +8,7 @@#ifdef __KERNEL__#include <asm/neon.h> +#include "neon.h" #else #define kernel_neon_begin ()#define kernel_neon_end ()@@ -19,13 +20,6 @@ static int raid6_has_neon(void)return cpu_has_neon (); } -void __raid6_2data_recov_neon (int bytes,uint8_t *p,uint8_t *q,uint8_t *dp, -uint8_t *dq,const uint8_t *pbmul, -const uint8_t *qmul); - -void __raid6_datap_recov_neon (int bytes,uint8_t *p,uint8_t *q,uint8_t *dq, -const uint8_t *qmul); -static void raid6_2data_recov_neon (int disks,size_t bytes,int faila,int failb,void **ptrs) {lib/raid6/recov_neon_inner.c +1
-1@@ -5,6 +5,7 @@*/ #include <arm_neon.h> +#include "neon.h" #ifdef CONFIG_ARM /* -- 2.39.2