powerpc/power: Expose pfn_is_nosave prototype
Subsystems (4)
PATCH 1/1 powerpc/power: Expose pfn_is_nosave prototype
The declaration for pfn_is_nosave is only available in kernel/power/power.h. Since this function can be override in arch, expose it globally. Having a prototype will make sure to avoid warning (sometime treated as error with W=1) such as:
arch/powerpc/kernel/suspend.c:18:5: error: no previous prototype for 'pfn_is_nosave' [-Werror=missing-prototypes]
This moves the declaration into a globally visible header file and add missing include to avoid a warning in powerpc.
--- arch/powerpc/kernel/suspend.c | 1 + include/linux/suspend.h | 1 + 2 files changed, 2 insertions(+)
arch/powerpc/kernel/suspend.c +1 -0
@@ -8,6 +8,7 @@*/ #include <linux/mm.h> +#include <linux/suspend.h> #include <asm/page.h> #include <asm/sections.h>
include/linux/suspend.h +1 -0
@@ -395,6 +395,7 @@ extern bool system_entering_hibernation(void);extern bool hibernation_available (void ); asmlinkage int swsusp_save(void);extern struct pbe *restore_pblist; +int pfn_is_nosave (unsigned long pfn);#else /* CONFIG_HIBERNATION */ static inline void register_nosave_region (unsigned long b,unsigned long e) {}static inline void register_nosave_region_late (unsigned long b,unsigned long e) {}
Signature · 1 line
2.20.1
Le 23/05/2019 à 13:47, Mathieu Malaterre a écrit :
Quoted 9 lines
The declaration for
pfn_is_nosaveis only available inkernel/power/power.h. Since this function can be override in arch, expose it globally. Having a prototype will make sure to avoid warning (sometime treated as error with W=1) such as:
arch/powerpc/kernel/suspend.c:18:5: error: no previous prototype for 'pfn_is_nosave' [-Werror=missing-prototypes]This moves the declaration into a globally visible header file and add missing include to avoid a warning in powerpc.
Then you should also drop it from kernel/power/power.h and arch/s390/kernel/entry.h
Christophe
Quoted 32 lines
Signed-off-by Mathieu Malaterre <[email protected]>--- arch/powerpc/kernel/suspend.c | 1 + include/linux/suspend.h | 1 + 2 files changed, 2 insertions(+)arch/powerpc/kernel/suspend.c +1
-0@@ -8,6 +8,7 @@*/ #include <linux/mm.h> +#include <linux/suspend.h> #include <asm/page.h> #include <asm/sections.h> include/linux/suspend.h +1
-0@@ -395,6 +395,7 @@ extern bool system_entering_hibernation(void);extern bool hibernation_available (void ); asmlinkage int swsusp_save(void);extern struct pbe *restore_pblist; +int pfn_is_nosave (unsigned long pfn);#else /* CONFIG_HIBERNATION */ static inline void register_nosave_region (unsigned long b,unsigned long e) {}static inline void register_nosave_region_late (unsigned long b,unsigned long e) {}
PATCH v2 1/1 powerpc/power: Expose pfn_is_nosave prototype
In reply to Mathieu MalaterreThe declaration for pfn_is_nosave is only available in kernel/power/power.h. Since this function can be override in arch, expose it globally. Having a prototype will make sure to avoid warning (sometime treated as error with W=1) such as:
arch/powerpc/kernel/suspend.c:18:5: error: no previous prototype for 'pfn_is_nosave' [-Werror=missing-prototypes]
This moves the declaration into a globally visible header file and add missing include to avoid a warning on powerpc. Also remove the duplicated prototypes since not required anymore.
---
v2: As suggestion by christophe remove duplicates prototypes
arch/powerpc/kernel/suspend.c | 1 + arch/s390/kernel/entry.h | 1 - include/linux/suspend.h | 1 + kernel/power/power.h | 2 -- 4 files changed, 2 insertions(+), 3 deletions(-)
arch/powerpc/kernel/suspend.c +1 -0
@@ -8,6 +8,7 @@*/ #include <linux/mm.h> +#include <linux/suspend.h> #include <asm/page.h> #include <asm/sections.h>
arch/s390/kernel/entry.h +0 -1
@@ -63,7 +63,6 @@ void __init startup_init(void);void die (struct pt_regs *regs,const char *str);int setup_profiling_timer (unsigned int multiplier);void __init time_init (void ); -int pfn_is_nosave (unsigned long );void s390_early_resume (void );unsigned long prepare_ftrace_return (unsigned long parent,unsigned long sp,unsigned long ip);
include/linux/suspend.h +1 -0
@@ -395,6 +395,7 @@ extern bool system_entering_hibernation(void);extern bool hibernation_available (void ); asmlinkage int swsusp_save(void);extern struct pbe *restore_pblist; +int pfn_is_nosave (unsigned long pfn);#else /* CONFIG_HIBERNATION */ static inline void register_nosave_region (unsigned long b,unsigned long e) {}static inline void register_nosave_region_late (unsigned long b,unsigned long e) {}
kernel/power/power.h +0 -2
@@ -75,8 +75,6 @@ static inline void hibernate_reserved_size_init(void) {}static inline void hibernate_image_size_init (void ) {}#endif /* !CONFIG_HIBERNATION */ -extern int pfn_is_nosave (unsigned long ); -#define power_attr (_name) \ static struct kobj_attribute _name##_attr = { \ .attr = { \
Signature · 1 line
2.20.1
Quoted 64 lines · CEST Mathieu Malaterre
The declaration for
pfn_is_nosaveis only available inkernel/power/power.h. Since this function can be override in arch, expose it globally. Having a prototype will make sure to avoid warning (sometime treated as error with W=1) such as:
arch/powerpc/kernel/suspend.c:18:5: error: no previous prototype for 'pfn_is_nosave' [-Werror=missing-prototypes]This moves the declaration into a globally visible header file and add missing include to avoid a warning on powerpc. Also remove the duplicated prototypes since not required anymore.
Cc Christophe Leroy <[email protected]>Signed-off-by Mathieu Malaterre <[email protected]>---
v2: As suggestion by christophe remove duplicates prototypesarch/powerpc/kernel/suspend.c | 1 + arch/s390/kernel/entry.h | 1 - include/linux/suspend.h | 1 + kernel/power/power.h | 2 -- 4 files changed, 2 insertions(+), 3 deletions(-)arch/powerpc/kernel/suspend.c +1
-0@@ -8,6 +8,7 @@*/ #include <linux/mm.h> +#include <linux/suspend.h> #include <asm/page.h> #include <asm/sections.h> arch/s390/kernel/entry.h +0
-1@@ -63,7 +63,6 @@ void __init startup_init(void);void die (struct pt_regs *regs,const char *str);int setup_profiling_timer (unsigned int multiplier);void __init time_init (void ); -int pfn_is_nosave (unsigned long );void s390_early_resume (void );unsigned long prepare_ftrace_return (unsigned long parent,unsigned long sp,unsigned long ip);include/linux/suspend.h +1
-0@@ -395,6 +395,7 @@ extern bool system_entering_hibernation(void);extern bool hibernation_available (void ); asmlinkage int swsusp_save(void);extern struct pbe *restore_pblist; +int pfn_is_nosave (unsigned long pfn);#else /* CONFIG_HIBERNATION */ static inline void register_nosave_region (unsigned long b,unsigned long e) {}static inline void register_nosave_region_late (unsigned long b,unsigned long e) {}kernel/power/power.h +0
-0
kernel/power/power.h static inline void hibernate_reserved_size_init(void) {} · line 80
Quoted 8 lines
kernel/power/power.h +0
-2@@ -75,8 +75,6 @@ static inline void hibernate_reserved_size_init(void) {}static inline void hibernate_image_size_init (void ) {}#endif /* !CONFIG_HIBERNATION */ -extern int pfn_is_nosave (unsigned long ); -#define power_attr (_name) \ static struct kobj_attribute _name##_attr = { \ .attr = { \
With an ACK from the powerpc maintainers, I could apply this one.
Michael Ellerman
reviewerQuoted 31 lines · Rafael J. Wysocki
Quoted 30 lines · CEST Mathieu Malaterre
The declaration for
pfn_is_nosaveis only available inkernel/power/power.h. Since this function can be override in arch, expose it globally. Having a prototype will make sure to avoid warning (sometime treated as error with W=1) such as:
arch/powerpc/kernel/suspend.c:18:5: error: no previous prototype for 'pfn_is_nosave' [-Werror=missing-prototypes]This moves the declaration into a globally visible header file and add missing include to avoid a warning on powerpc. Also remove the duplicated prototypes since not required anymore.
Cc Christophe Leroy <[email protected]>Signed-off-by Mathieu Malaterre <[email protected]>---
v2: As suggestion by christophe remove duplicates prototypesarch/powerpc/kernel/suspend.c | 1 + arch/s390/kernel/entry.h | 1 - include/linux/suspend.h | 1 + kernel/power/power.h | 2 -- 4 files changed, 2 insertions(+), 3 deletions(-)kernel/power/power.h +0
-0@@ -75,8 +75,6 @@ static inline void hibernate_reserved_size_init(void) {}static inline void hibernate_image_size_init (void ) {}#endif /* !CONFIG_HIBERNATION */
Quoted 8 lines
kernel/power/power.h static inline void hibernate_reserved_size_init(void) {} · line 80
Quoted 6 lines
kernel/power/power.h +0
-2-extern int pfn_is_nosave (unsigned long ); -#define power_attr (_name) \ static struct kobj_attribute _name##_attr = { \ .attr = { \With an ACK from the powerpc maintainers, I could apply this one.
Sent.
cheers
Quoted 41 lines · CEST Michael Ellerman
Quoted 31 lines · Rafael J. Wysocki
Quoted 30 lines · CEST Mathieu Malaterre
The declaration for
pfn_is_nosaveis only available inkernel/power/power.h. Since this function can be override in arch, expose it globally. Having a prototype will make sure to avoid warning (sometime treated as error with W=1) such as:
arch/powerpc/kernel/suspend.c:18:5: error: no previous prototype for 'pfn_is_nosave' [-Werror=missing-prototypes]This moves the declaration into a globally visible header file and add missing include to avoid a warning on powerpc. Also remove the duplicated prototypes since not required anymore.
Cc Christophe Leroy <[email protected]>Signed-off-by Mathieu Malaterre <[email protected]>---
v2: As suggestion by christophe remove duplicates prototypesarch/powerpc/kernel/suspend.c | 1 + arch/s390/kernel/entry.h | 1 - include/linux/suspend.h | 1 + kernel/power/power.h | 2 -- 4 files changed, 2 insertions(+), 3 deletions(-)kernel/power/power.h +0
-0@@ -75,8 +75,6 @@ static inline void hibernate_reserved_size_init(void) {}static inline void hibernate_image_size_init (void ) {}#endif /* !CONFIG_HIBERNATION */ Quoted 8 lines
kernel/power/power.h static inline void hibernate_reserved_size_init(void) {} · line 80
Quoted 6 lines
kernel/power/power.h +0
-2-extern int pfn_is_nosave (unsigned long ); -#define power_attr (_name) \ static struct kobj_attribute _name##_attr = { \ .attr = { \With an ACK from the powerpc maintainers, I could apply this one.
Quoted 1 line
Sent.
Thanks!
Quoted 13 lines · Mathieu Malaterre
The declaration for
pfn_is_nosaveis only available inkernel/power/power.h. Since this function can be override in arch, expose it globally. Having a prototype will make sure to avoid warning (sometime treated as error with W=1) such as:
arch/powerpc/kernel/suspend.c:18:5: error: no previous prototype for 'pfn_is_nosave' [-Werror=missing-prototypes]This moves the declaration into a globally visible header file and add missing include to avoid a warning on powerpc. Also remove the duplicated prototypes since not required anymore.
Cc Christophe Leroy <[email protected]>Signed-off-by Mathieu Malaterre <[email protected]>
Quoted 8 lines
---
v2: As suggestion by christophe remove duplicates prototypesarch/powerpc/kernel/suspend.c | 1 + arch/s390/kernel/entry.h | 1 - include/linux/suspend.h | 1 + kernel/power/power.h | 2 -- 4 files changed, 2 insertions(+), 3 deletions(-)
Looks fine to me.
cheers
Rafael J. Wysocki
AppliedQuoted 64 lines · CEST Mathieu Malaterre
The declaration for
pfn_is_nosaveis only available inkernel/power/power.h. Since this function can be override in arch, expose it globally. Having a prototype will make sure to avoid warning (sometime treated as error with W=1) such as:
arch/powerpc/kernel/suspend.c:18:5: error: no previous prototype for 'pfn_is_nosave' [-Werror=missing-prototypes]This moves the declaration into a globally visible header file and add missing include to avoid a warning on powerpc. Also remove the duplicated prototypes since not required anymore.
Cc Christophe Leroy <[email protected]>Signed-off-by Mathieu Malaterre <[email protected]>---
v2: As suggestion by christophe remove duplicates prototypesarch/powerpc/kernel/suspend.c | 1 + arch/s390/kernel/entry.h | 1 - include/linux/suspend.h | 1 + kernel/power/power.h | 2 -- 4 files changed, 2 insertions(+), 3 deletions(-)arch/powerpc/kernel/suspend.c +1
-0@@ -8,6 +8,7 @@*/ #include <linux/mm.h> +#include <linux/suspend.h> #include <asm/page.h> #include <asm/sections.h> arch/s390/kernel/entry.h +0
-1@@ -63,7 +63,6 @@ void __init startup_init(void);void die (struct pt_regs *regs,const char *str);int setup_profiling_timer (unsigned int multiplier);void __init time_init (void ); -int pfn_is_nosave (unsigned long );void s390_early_resume (void );unsigned long prepare_ftrace_return (unsigned long parent,unsigned long sp,unsigned long ip);include/linux/suspend.h +1
-0@@ -395,6 +395,7 @@ extern bool system_entering_hibernation(void);extern bool hibernation_available (void ); asmlinkage int swsusp_save(void);extern struct pbe *restore_pblist; +int pfn_is_nosave (unsigned long pfn);#else /* CONFIG_HIBERNATION */ static inline void register_nosave_region (unsigned long b,unsigned long e) {}static inline void register_nosave_region_late (unsigned long b,unsigned long e) {}kernel/power/power.h +0
-0
kernel/power/power.h static inline void hibernate_reserved_size_init(void) {} · line 80
Quoted 8 lines
kernel/power/power.h +0
-2@@ -75,8 +75,6 @@ static inline void hibernate_reserved_size_init(void) {}static inline void hibernate_image_size_init (void ) {}#endif /* !CONFIG_HIBERNATION */ -extern int pfn_is_nosave (unsigned long ); -#define power_attr (_name) \ static struct kobj_attribute _name##_attr = { \ .attr = { \
Applied, thanks!