Skip to content

Commit

Permalink
PM: hibernate: powerpc: Expose pfn_is_nosave() prototype
Browse files Browse the repository at this point in the history
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 on powerpc.

Also remove the duplicated prototypes since not required anymore.

Signed-off-by: Mathieu Malaterre <[email protected]>
Acked-by: Michael Ellerman <[email protected]> (powerpc)
Signed-off-by: Rafael J. Wysocki <[email protected]>
  • Loading branch information
malaterre authored and rafaeljw committed Jun 14, 2019
1 parent d1fdb6d commit 1ec0cd8
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 3 deletions.
1 change: 1 addition & 0 deletions arch/powerpc/kernel/suspend.c
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
*/

#include <linux/mm.h>
#include <linux/suspend.h>
#include <asm/page.h>
#include <asm/sections.h>

Expand Down
1 change: 0 additions & 1 deletion arch/s390/kernel/entry.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down
1 change: 1 addition & 0 deletions include/linux/suspend.h
Original file line number Diff line number Diff line change
Expand Up @@ -426,6 +426,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) {}
Expand Down
2 changes: 0 additions & 2 deletions kernel/power/power.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 = { \
Expand Down

0 comments on commit 1ec0cd8

Please sign in to comment.