[PATCH] powerpc: fix sparse warning, include kernel header

Daniel Axtens dja at axtens.net
Fri Mar 10 11:40:23 AEDT 2017


Hi Tobin,

I have built the kernel with the ppc6xx_defconfig with and without your
patch.

Using my smart-sparse-diff tool[1], I have confirmed the warning
disappears:

-/scratch/dja/linux/arch/powerpc/kernel/swsusp.c:17:6: warning: symbol 'save_processor_state' was not declared. Should it be static?
-/scratch/dja/linux/arch/powerpc/kernel/swsusp.c:31:6: warning: symbol 'restore_processor_state' was not declared. Should it be static?

As such, this patch is:

Reviewed-by: Daniel Axtens <dja at axtens.net>

Thanks for fixing this!

Regards,
Daniel

[1] https://github.com/daxtens/smart-sparse-diff

"Tobin C. Harding" <me at tobin.cc> writes:

> Spares emits two symbol not declared warnings. The two functions in
> question are declared already in a kernel header.
>
> Add include directive to include kernel header.
>
> Signed-off-by: Tobin C. Harding <me at tobin.cc>
> ---
>
> github issue: #37 Fix sparse errors
>
>  arch/powerpc/kernel/swsusp.c | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/arch/powerpc/kernel/swsusp.c b/arch/powerpc/kernel/swsusp.c
> index 6ae9bd5..0050b2d 100644
> --- a/arch/powerpc/kernel/swsusp.c
> +++ b/arch/powerpc/kernel/swsusp.c
> @@ -10,6 +10,7 @@
>   */
>  
>  #include <linux/sched.h>
> +#include <linux/suspend.h>
>  #include <asm/current.h>
>  #include <asm/mmu_context.h>
>  #include <asm/switch_to.h>
> -- 
> 2.7.4


More information about the Linuxppc-dev mailing list