[PATCH 4/7] powerpc/xive: Fix W=1 compile warning

Christophe Leroy christophe.leroy at csgroup.eu
Fri Sep 11 15:40:16 AEST 2020



Le 10/09/2020 à 23:02, Cédric Le Goater a écrit :
> CC      arch/powerpc/sysdev/xive/common.o
> ../arch/powerpc/sysdev/xive/common.c:1568:6: error: no previous prototype for ‘xive_debug_show_cpu’ [-Werror=missing-prototypes]
>   void xive_debug_show_cpu(struct seq_file *m, int cpu)
>        ^~~~~~~~~~~~~~~~~~~
> ../arch/powerpc/sysdev/xive/common.c:1602:6: error: no previous prototype for ‘xive_debug_show_irq’ [-Werror=missing-prototypes]
>   void xive_debug_show_irq(struct seq_file *m, u32 hw_irq, struct irq_data *d)
>        ^~~~~~~~~~~~~~~~~~~
> 

A small sentence explaining how this is fixed would be welcome, so that 
you don't need to read the code the know what the commit does to fix the 
warning. Also the subject should be more explicit.

There are two ways of fixing it:
- Add the missing prototype
- Make it static

You chose the second alternative, this needs to be told in the commit log.


> Signed-off-by: Cédric Le Goater <clg at kaod.org>

Reviewed-by: Christophe Leroy <christophe.leroy at csgroup.eu>

> ---
>   arch/powerpc/sysdev/xive/common.c | 4 ++--
>   1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/arch/powerpc/sysdev/xive/common.c b/arch/powerpc/sysdev/xive/common.c
> index f591be9f01f4..a80440af491a 100644
> --- a/arch/powerpc/sysdev/xive/common.c
> +++ b/arch/powerpc/sysdev/xive/common.c
> @@ -1565,7 +1565,7 @@ static int __init xive_off(char *arg)
>   }
>   __setup("xive=off", xive_off);
>   
> -void xive_debug_show_cpu(struct seq_file *m, int cpu)
> +static void xive_debug_show_cpu(struct seq_file *m, int cpu)
>   {
>   	struct xive_cpu *xc = per_cpu(xive_cpu, cpu);
>   
> @@ -1599,7 +1599,7 @@ void xive_debug_show_cpu(struct seq_file *m, int cpu)
>   	seq_puts(m, "\n");
>   }
>   
> -void xive_debug_show_irq(struct seq_file *m, u32 hw_irq, struct irq_data *d)
> +static void xive_debug_show_irq(struct seq_file *m, u32 hw_irq, struct irq_data *d)
>   {
>   	struct irq_chip *chip = irq_data_get_irq_chip(d);
>   	int rc;
> 


More information about the Linuxppc-dev mailing list