PM: hibernate: powerpc: Expose pfn_is_nosave() prototype
authorMathieu Malaterre <malat@debian.org>
Fri, 24 May 2019 10:44:18 +0000 (12:44 +0200)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Fri, 14 Jun 2019 08:48:56 +0000 (10:48 +0200)
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 <malat@debian.org>
Acked-by: Michael Ellerman <mpe@ellerman.id.au> (powerpc)
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
arch/powerpc/kernel/suspend.c
arch/s390/kernel/entry.h
include/linux/suspend.h
kernel/power/power.h

index c612d50c9d18b6e5aacf6ad43765ea63900a2e4a..b84992c10854d778b1c7987b4278cef13820abbf 100644 (file)
@@ -7,6 +7,7 @@
  */
 
 #include <linux/mm.h>
+#include <linux/suspend.h>
 #include <asm/page.h>
 #include <asm/sections.h>
 
index 20420c2b8a146964e2018edc25fd1393d2823f45..b2956d49b6ad76be0ce50d5dd51d81796b96f00c 100644 (file)
@@ -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);
 
index 8594001e8be880738ac28f96328071e71a872b4d..05645f726815e24fe45fc7dd3b564ff50ea274a0 100644 (file)
@@ -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) {}
index 9e58bdc8a562b935450364776b15077f60d420c3..44bee462ff5791ab2408da2b8b5a6d3b4065b6ea 100644 (file)
@@ -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   = {                             \