Skip to contentSkip to conversation

powerpc: fix sparse warning, include kernel header

PATCH Applied Tobin C. Harding 3 participants 4 messages Mar 6, 2017 – Mar 21, 2017 PowerPC

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 powerpc: fix sparse warning, include kernel header

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.

---

github issue: #37 Fix sparse errors

 arch/powerpc/kernel/swsusp.c | 1 +
 1 file changed, 1 insertion(+)
arch/powerpc/kernel/swsusp.c +1 -0
index 6ae9bd5..0050b2d 100644
@@ -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>
Signature · 1 line
2.7.4
Reviewed-by on v1 1/1
#1 lore raw

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:

Thanks for fixing this!

Regards,
Daniel

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

Quoted 27 lines · Tobin C. Harding

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.

---

github issue: #37 Fix sparse errors

 arch/powerpc/kernel/swsusp.c | 1 +
 1 file changed, 1 insertion(+)
arch/powerpc/kernel/swsusp.c +1 -0
index 6ae9bd5..0050b2d 100644
@@ -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>
Signature · 1 line
2.7.4
#2 lore raw
Quoted 11 lines · Daniel Axtens

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:

(quoted diff) +0 -2
-/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?
Quoted 3 lines

As such, this patch is:

Awesome, thanks Daniel

Quoted 37 lines

Thanks for fixing this!

Regards,
Daniel

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

Quoted 27 lines · Tobin C. Harding

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.

---

github issue: #37 Fix sparse errors

 arch/powerpc/kernel/swsusp.c | 1 +
 1 file changed, 1 insertion(+)
arch/powerpc/kernel/swsusp.c +1 -0
index 6ae9bd5..0050b2d 100644
@@ -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>
Signature · 1 line
2.7.4
Signature · 2 lines
Tobin Harding
http://tobin.cc