lkml.org 
[lkml]   [2018]   [Mar]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH 14/19] powerpc/altivec: Add missing prototypes for altivec
On Tue, Mar 27, 2018 at 7:33 PM, LEROY Christophe
<christophe.leroy@c-s.fr> wrote:
> LEROY Christophe <christophe.leroy@c-s.fr> a écrit :
>
>
>> Mathieu Malaterre <malat@debian.org> a écrit :
>>
>>> Christophe,
>>>
>>> On Sat, Mar 24, 2018 at 9:10 PM, LEROY Christophe
>>> <christophe.leroy@c-s.fr> wrote:
>>>>
>>>> Mathieu Malaterre <malat@debian.org> a écrit :
>>>>
>>>>
>>>>> On Fri, Mar 23, 2018 at 1:19 PM, christophe leroy
>>>>> <christophe.leroy@c-s.fr> wrote:
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>> Le 22/03/2018 à 21:20, Mathieu Malaterre a écrit :
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> Some functions prototypes were missing for the non-altivec code. Add
>>>>>>> the
>>>>>>> missing prototypes directly in xor_vmx, 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]
>>>>>>>
>>>>>>> Signed-off-by: Mathieu Malaterre <malat@debian.org>
>>>>>>> ---
>>>>>>> arch/powerpc/lib/xor_vmx.h | 14 ++++++++++++++
>>>>>>> 1 file changed, 14 insertions(+)
>>>>>>>
>>>>>>> diff --git a/arch/powerpc/lib/xor_vmx.h b/arch/powerpc/lib/xor_vmx.h
>>>>>>> index 5c2b0839b179..2173e3c84151 100644
>>>>>>> --- a/arch/powerpc/lib/xor_vmx.h
>>>>>>> +++ b/arch/powerpc/lib/xor_vmx.h
>>>>>>> @@ -19,3 +19,17 @@ void __xor_altivec_4(unsigned long bytes, unsigned
>>>>>>> long
>>>>>>> *v1_in,
>>>>>>> void __xor_altivec_5(unsigned long bytes, unsigned long *v1_in,
>>>>>>> unsigned long *v2_in, unsigned long
>>>>>>> *v3_in,
>>>>>>> unsigned long *v4_in, unsigned long
>>>>>>> *v5_in);
>>>>>>> +
>>>>>>> +void xor_altivec_2(unsigned long bytes, unsigned long *v1_in,
>>>>>>> + unsigned long *v2_in);
>>>>>>> +
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>> Only used in one place, should be static instead of adding it in a .h
>>>>>>
>>>>>> Same for the other ones.
>>>>>
>>>>>
>>>>>
>>>>> $ git grep xor_altivec_2
>>>>> [...]
>>>>> arch/powerpc/lib/xor_vmx_glue.c:EXPORT_SYMBOL(xor_altivec_2);
>>>>>
>>>>> Are you sure I can change this function to static ?
>>>>
>>>>
>>>>
>>>> Yes you are right. But in fact those fonctions are already defined in
>>>> asm/xor. h
>>>> So you just need to add the missing #include
>>>
>>>
>>> I originally tried it, but this leads to:
>>>
>>> CC arch/powerpc/lib/xor_vmx_glue.o
>>> In file included from arch/powerpc/lib/xor_vmx_glue.c:16:0:
>>> ./arch/powerpc/include/asm/xor.h:39:15: error: variable
>>> ‘xor_block_altivec’ has initializer but incomplete type
>>> static struct xor_block_template xor_block_altivec = {
>>> ^~~~~~~~~~~~~~~~~~
>>> ./arch/powerpc/include/asm/xor.h:40:2: error: unknown field ‘name’
>>> specified in initializer
>>> .name = "altivec",
>>> ^
>>> [...]
>>>
>>> The file <asm/xor.h> (powerpc) is pretty much expected to be included
>>> after <include/linux/raid/xor.h>.
>>>
>>> I did not want to tweak <asm/xor.h> to test for #ifdef _XOR_H just before
>>>
>>> #ifdef _XOR_H
>>> static struct xor_block_template xor_block_altivec = {
>>> [...]
>>>
>>> since this seems like a hack to me.
>>>
>>> Is this ok to test for #ifdef _XOR_H in <arch/powerpc/include/asm/xor.h>
>>> ?
>>
>>
>> What about including linux/raid/xor.h in asm/xor.h ?

This leads to:

CALL ../arch/powerpc/kernel/systbl_chk.sh
In file included from ../arch/powerpc/include/asm/xor.h:57:0,
from ../arch/powerpc/lib/xor_vmx_glue.c:17:
../include/asm-generic/xor.h:688:34: error: ‘xor_block_32regs’ defined
but not used [-Werror=unused-variable]
static struct xor_block_template xor_block_32regs = {
^~~~~~~~~~~~~~~~
../include/asm-generic/xor.h:680:34: error: ‘xor_block_8regs’ defined
but not used [-Werror=unused-variable]
static struct xor_block_template xor_block_8regs = {
^~~~~~~~~~~~~~~
In file included from ../arch/powerpc/lib/xor_vmx_glue.c:17:0:
../arch/powerpc/include/asm/xor.h:39:34: error: ‘xor_block_altivec’
defined but not used [-Werror=unused-variable]
static struct xor_block_template xor_block_altivec = {
^~~~~~~~~~~~~~~~~
CALL ../arch/powerpc/kernel/prom_init_check.sh


>
> Or better: including linux/raid/xor.h then asm/xor.h in xor_vmx_glue.c ?
>
> Christophe
>
>>
>> Christophe
>>>
>>>
>>>> Christophe
>>>>
>>>>
>>>>>
>>>>>> Christophe
>>>>>>
>>>>>>
>>>>>>> +void xor_altivec_3(unsigned long bytes, unsigned long *v1_in,
>>>>>>> + unsigned long *v2_in, unsigned long
>>>>>>> *v3_in);
>>>>>>> +
>>>>>>> +void xor_altivec_4(unsigned long bytes, unsigned long *v1_in,
>>>>>>> + unsigned long *v2_in, unsigned long
>>>>>>> *v3_in,
>>>>>>> + unsigned long *v4_in);
>>>>>>> +
>>>>>>> +void xor_altivec_5(unsigned long bytes, unsigned long *v1_in,
>>>>>>> + unsigned long *v2_in, unsigned long
>>>>>>> *v3_in,
>>>>>>> + unsigned long *v4_in, unsigned long
>>>>>>> *v5_in);
>>>>>>>
>>>>>>
>>>>>> ---
>>>>>> L'absence de virus dans ce courrier électronique a été vérifiée par le
>>>>>> logiciel antivirus Avast.
>>>>>> https://www.avast.com/antivirus
>>>>>>
>>>>
>>>>
>
>

\
 
 \ /
  Last update: 2018-03-28 09:29    [W:0.115 / U:0.492 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site