Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

powerpc/altivec: Add missing prototypes for altivec

Some functions prototypes were missing for the non-altivec code. Add the
missing prototypes in a new header file, fix warnings treated as errors
with W=1:

arch/powerpc/lib/xor_vmx_glue.c:18:6: error: no previous prototype for ‘xor_altivec_2’ [-Werror=missing-prototypes]
arch/powerpc/lib/xor_vmx_glue.c:29:6: error: no previous prototype for ‘xor_altivec_3’ [-Werror=missing-prototypes]
arch/powerpc/lib/xor_vmx_glue.c:40:6: error: no previous prototype for ‘xor_altivec_4’ [-Werror=missing-prototypes]
arch/powerpc/lib/xor_vmx_glue.c:52:6: error: no previous prototype for ‘xor_altivec_5’ [-Werror=missing-prototypes]

The prototypes were already present in <asm/xor.h> but this header file is
meant to be included after <include/linux/raid/xor.h>. Trying to re-use
<asm/xor.h> directly would lead to warnings such as:

arch/powerpc/include/asm/xor.h:39:15: error: variable ‘xor_block_altivec’ has initializer but incomplete type

Trying to re-use <asm/xor.h> after <include/linux/raid/xor.h> in
xor_vmx_glue.c would in turn trigger the following warnings:

include/asm-generic/xor.h:688:34: error: ‘xor_block_32regs’ defined but not used [-Werror=unused-variable]

Signed-off-by: Mathieu Malaterre <malat@debian.org>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>

authored by

Mathieu Malaterre and committed by
Michael Ellerman
7cf76a68 eae5f709

+21 -11
+1 -11
arch/powerpc/include/asm/xor.h
··· 24 24 25 25 #include <asm/cputable.h> 26 26 #include <asm/cpu_has_feature.h> 27 - 28 - void xor_altivec_2(unsigned long bytes, unsigned long *v1_in, 29 - unsigned long *v2_in); 30 - void xor_altivec_3(unsigned long bytes, unsigned long *v1_in, 31 - unsigned long *v2_in, unsigned long *v3_in); 32 - void xor_altivec_4(unsigned long bytes, unsigned long *v1_in, 33 - unsigned long *v2_in, unsigned long *v3_in, 34 - unsigned long *v4_in); 35 - void xor_altivec_5(unsigned long bytes, unsigned long *v1_in, 36 - unsigned long *v2_in, unsigned long *v3_in, 37 - unsigned long *v4_in, unsigned long *v5_in); 27 + #include <asm/xor_altivec.h> 38 28 39 29 static struct xor_block_template xor_block_altivec = { 40 30 .name = "altivec",
+19
arch/powerpc/include/asm/xor_altivec.h
··· 1 + /* SPDX-License-Identifier: GPL-2.0 */ 2 + #ifndef _ASM_POWERPC_XOR_ALTIVEC_H 3 + #define _ASM_POWERPC_XOR_ALTIVEC_H 4 + 5 + #ifdef CONFIG_ALTIVEC 6 + 7 + void xor_altivec_2(unsigned long bytes, unsigned long *v1_in, 8 + unsigned long *v2_in); 9 + void xor_altivec_3(unsigned long bytes, unsigned long *v1_in, 10 + unsigned long *v2_in, unsigned long *v3_in); 11 + void xor_altivec_4(unsigned long bytes, unsigned long *v1_in, 12 + unsigned long *v2_in, unsigned long *v3_in, 13 + unsigned long *v4_in); 14 + void xor_altivec_5(unsigned long bytes, unsigned long *v1_in, 15 + unsigned long *v2_in, unsigned long *v3_in, 16 + unsigned long *v4_in, unsigned long *v5_in); 17 + 18 + #endif 19 + #endif /* _ASM_POWERPC_XOR_ALTIVEC_H */
+1
arch/powerpc/lib/xor_vmx_glue.c
··· 13 13 #include <linux/export.h> 14 14 #include <linux/sched.h> 15 15 #include <asm/switch_to.h> 16 + #include <asm/xor_altivec.h> 16 17 #include "xor_vmx.h" 17 18 18 19 void xor_altivec_2(unsigned long bytes, unsigned long *v1_in,