diff mbox series

[11/19] powerpc/powermac: Move pmac_pfunc_base_install prototype to header file

Message ID 20180322202007.23088-12-malat@debian.org (mailing list archive)
State Superseded
Headers show
Series powerpc/ppc32: make W=1 compilation errors free | expand

Commit Message

Mathieu Malaterre March 22, 2018, 8:19 p.m. UTC
The pmac_pfunc_base_install prototype was declared in powermac/smp.c since
function was used there, move it to pmac_pfunc.h header to be visible in
pfunc_base.c. Fix a warning treated as error with W=1:

  arch/powerpc/platforms/powermac/pfunc_base.c:330:12: error: no previous prototype for ‘pmac_pfunc_base_install’ [-Werror=missing-prototypes]

Signed-off-by: Mathieu Malaterre <malat@debian.org>
---
 arch/powerpc/include/asm/pmac_pfunc.h | 1 +
 arch/powerpc/platforms/powermac/smp.c | 1 -
 2 files changed, 1 insertion(+), 1 deletion(-)

Comments

Christophe Leroy March 23, 2018, 12:13 p.m. UTC | #1
Le 22/03/2018 à 21:19, Mathieu Malaterre a écrit :
> The pmac_pfunc_base_install prototype was declared in powermac/smp.c since
> function was used there, move it to pmac_pfunc.h header to be visible in
> pfunc_base.c. Fix a warning treated as error with W=1:
> 
>    arch/powerpc/platforms/powermac/pfunc_base.c:330:12: error: no previous prototype for ‘pmac_pfunc_base_install’ [-Werror=missing-prototypes]
> 
> Signed-off-by: Mathieu Malaterre <malat@debian.org>
> ---
>   arch/powerpc/include/asm/pmac_pfunc.h | 1 +
>   arch/powerpc/platforms/powermac/smp.c | 1 -
>   2 files changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/arch/powerpc/include/asm/pmac_pfunc.h b/arch/powerpc/include/asm/pmac_pfunc.h
> index 73bd8f28f2a8..99f7a288789a 100644
> --- a/arch/powerpc/include/asm/pmac_pfunc.h
> +++ b/arch/powerpc/include/asm/pmac_pfunc.h
> @@ -245,6 +245,7 @@ extern void pmf_put_function(struct pmf_function *func);
>   
>   extern int pmf_call_one(struct pmf_function *func, struct pmf_args *args);
>   
> +extern int pmac_pfunc_base_install(void);


extern keyword is not needed

Christophe

>   
>   /* Suspend/resume code called by via-pmu directly for now */
>   extern void pmac_pfunc_base_suspend(void);
> diff --git a/arch/powerpc/platforms/powermac/smp.c b/arch/powerpc/platforms/powermac/smp.c
> index 95275e0e2efa..447da6db450a 100644
> --- a/arch/powerpc/platforms/powermac/smp.c
> +++ b/arch/powerpc/platforms/powermac/smp.c
> @@ -65,7 +65,6 @@
>   #endif
>   
>   extern void __secondary_start_pmac_0(void);
> -extern int pmac_pfunc_base_install(void);
>   
>   static void (*pmac_tb_freeze)(int freeze);
>   static u64 timebase;
> 

---
L'absence de virus dans ce courrier électronique a été vérifiée par le logiciel antivirus Avast.
https://www.avast.com/antivirus
Mathieu Malaterre March 28, 2018, 7:11 p.m. UTC | #2
On Fri, Mar 23, 2018 at 1:13 PM, christophe leroy
<christophe.leroy@c-s.fr> wrote:
>
>
> Le 22/03/2018 à 21:19, Mathieu Malaterre a écrit :
>>
>> The pmac_pfunc_base_install prototype was declared in powermac/smp.c since
>> function was used there, move it to pmac_pfunc.h header to be visible in
>> pfunc_base.c. Fix a warning treated as error with W=1:
>>
>>    arch/powerpc/platforms/powermac/pfunc_base.c:330:12: error: no previous
>> prototype for ‘pmac_pfunc_base_install’ [-Werror=missing-prototypes]
>>
>> Signed-off-by: Mathieu Malaterre <malat@debian.org>
>> ---
>>   arch/powerpc/include/asm/pmac_pfunc.h | 1 +
>>   arch/powerpc/platforms/powermac/smp.c | 1 -
>>   2 files changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/arch/powerpc/include/asm/pmac_pfunc.h
>> b/arch/powerpc/include/asm/pmac_pfunc.h
>> index 73bd8f28f2a8..99f7a288789a 100644
>> --- a/arch/powerpc/include/asm/pmac_pfunc.h
>> +++ b/arch/powerpc/include/asm/pmac_pfunc.h
>> @@ -245,6 +245,7 @@ extern void pmf_put_function(struct pmf_function
>> *func);
>>     extern int pmf_call_one(struct pmf_function *func, struct pmf_args
>> *args);
>>   +extern int pmac_pfunc_base_install(void);
>
>
>
> extern keyword is not needed

I understand; but for consistency every single protoypes in this
header file actually use the extern keyword. Is there a guide/best
practice to refer to in this case ?

> Christophe
>
>>     /* Suspend/resume code called by via-pmu directly for now */
>>   extern void pmac_pfunc_base_suspend(void);
>> diff --git a/arch/powerpc/platforms/powermac/smp.c
>> b/arch/powerpc/platforms/powermac/smp.c
>> index 95275e0e2efa..447da6db450a 100644
>> --- a/arch/powerpc/platforms/powermac/smp.c
>> +++ b/arch/powerpc/platforms/powermac/smp.c
>> @@ -65,7 +65,6 @@
>>   #endif
>>     extern void __secondary_start_pmac_0(void);
>> -extern int pmac_pfunc_base_install(void);
>>     static void (*pmac_tb_freeze)(int freeze);
>>   static u64 timebase;
>>
>
> ---
> L'absence de virus dans ce courrier électronique a été vérifiée par le
> logiciel antivirus Avast.
> https://www.avast.com/antivirus
>
Christophe Leroy March 29, 2018, 3:51 p.m. UTC | #3
Mathieu Malaterre <malat@debian.org> a écrit :

> On Fri, Mar 23, 2018 at 1:13 PM, christophe leroy
> <christophe.leroy@c-s.fr> wrote:
>>
>>
>> Le 22/03/2018 à 21:19, Mathieu Malaterre a écrit :
>>>
>>> The pmac_pfunc_base_install prototype was declared in powermac/smp.c since
>>> function was used there, move it to pmac_pfunc.h header to be visible in
>>> pfunc_base.c. Fix a warning treated as error with W=1:
>>>
>>>    arch/powerpc/platforms/powermac/pfunc_base.c:330:12: error: no previous
>>> prototype for ‘pmac_pfunc_base_install’ [-Werror=missing-prototypes]
>>>
>>> Signed-off-by: Mathieu Malaterre <malat@debian.org>
>>> ---
>>>   arch/powerpc/include/asm/pmac_pfunc.h | 1 +
>>>   arch/powerpc/platforms/powermac/smp.c | 1 -
>>>   2 files changed, 1 insertion(+), 1 deletion(-)
>>>
>>> diff --git a/arch/powerpc/include/asm/pmac_pfunc.h
>>> b/arch/powerpc/include/asm/pmac_pfunc.h
>>> index 73bd8f28f2a8..99f7a288789a 100644
>>> --- a/arch/powerpc/include/asm/pmac_pfunc.h
>>> +++ b/arch/powerpc/include/asm/pmac_pfunc.h
>>> @@ -245,6 +245,7 @@ extern void pmf_put_function(struct pmf_function
>>> *func);
>>>     extern int pmf_call_one(struct pmf_function *func, struct pmf_args
>>> *args);
>>>   +extern int pmac_pfunc_base_install(void);
>>
>>
>>
>> extern keyword is not needed
>
> I understand; but for consistency every single protoypes in this
> header file actually use the extern keyword. Is there a guide/best
> practice to refer to in this case ?

Consistancy is not a valid reason to continue bad practice. Every  
single modufication is an opportunity to clean things up

You should run script/checkpatch.pl --strict on all your patches  
before submitting.
And follow as much as possible the linux codying style

Christophe

>
>> Christophe
>>
>>>     /* Suspend/resume code called by via-pmu directly for now */
>>>   extern void pmac_pfunc_base_suspend(void);
>>> diff --git a/arch/powerpc/platforms/powermac/smp.c
>>> b/arch/powerpc/platforms/powermac/smp.c
>>> index 95275e0e2efa..447da6db450a 100644
>>> --- a/arch/powerpc/platforms/powermac/smp.c
>>> +++ b/arch/powerpc/platforms/powermac/smp.c
>>> @@ -65,7 +65,6 @@
>>>   #endif
>>>     extern void __secondary_start_pmac_0(void);
>>> -extern int pmac_pfunc_base_install(void);
>>>     static void (*pmac_tb_freeze)(int freeze);
>>>   static u64 timebase;
>>>
>>
>> ---
>> L'absence de virus dans ce courrier électronique a été vérifiée par le
>> logiciel antivirus Avast.
>> https://www.avast.com/antivirus
>>
diff mbox series

Patch

diff --git a/arch/powerpc/include/asm/pmac_pfunc.h b/arch/powerpc/include/asm/pmac_pfunc.h
index 73bd8f28f2a8..99f7a288789a 100644
--- a/arch/powerpc/include/asm/pmac_pfunc.h
+++ b/arch/powerpc/include/asm/pmac_pfunc.h
@@ -245,6 +245,7 @@  extern void pmf_put_function(struct pmf_function *func);
 
 extern int pmf_call_one(struct pmf_function *func, struct pmf_args *args);
 
+extern int pmac_pfunc_base_install(void);
 
 /* Suspend/resume code called by via-pmu directly for now */
 extern void pmac_pfunc_base_suspend(void);
diff --git a/arch/powerpc/platforms/powermac/smp.c b/arch/powerpc/platforms/powermac/smp.c
index 95275e0e2efa..447da6db450a 100644
--- a/arch/powerpc/platforms/powermac/smp.c
+++ b/arch/powerpc/platforms/powermac/smp.c
@@ -65,7 +65,6 @@ 
 #endif
 
 extern void __secondary_start_pmac_0(void);
-extern int pmac_pfunc_base_install(void);
 
 static void (*pmac_tb_freeze)(int freeze);
 static u64 timebase;