Skip to content

Commit 8a3e82d

Browse files
arndbhansendc
authored andcommitted
x86/hibernate: Declare global functions in suspend.h
Three functions that are defined in x86 specific code to override generic __weak implementations cause a warning because of a missing prototype: arch/x86/power/cpu.c:298:5: error: no previous prototype for 'hibernate_resume_nonboot_cpu_disable' [-Werror=missing-prototypes] arch/x86/power/hibernate.c:129:5: error: no previous prototype for 'arch_hibernation_header_restore' [-Werror=missing-prototypes] arch/x86/power/hibernate.c:91:5: error: no previous prototype for 'arch_hibernation_header_save' [-Werror=missing-prototypes] Move the declarations into a global header so it can be included by any file defining one of these. Signed-off-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Dave Hansen <dave.hansen@linux.intel.com> Reviewed-by: Alexander Lobakin <aleksander.lobakin@intel.com> Link: https://lore.kernel.org/all/20230516193549.544673-14-arnd%40kernel.org
1 parent f34f0d3 commit 8a3e82d

2 files changed

Lines changed: 4 additions & 5 deletions

File tree

include/linux/suspend.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -452,6 +452,10 @@ extern struct pbe *restore_pblist;
452452
int pfn_is_nosave(unsigned long pfn);
453453

454454
int hibernate_quiet_exec(int (*func)(void *data), void *data);
455+
int hibernate_resume_nonboot_cpu_disable(void);
456+
int arch_hibernation_header_save(void *addr, unsigned int max_size);
457+
int arch_hibernation_header_restore(void *addr);
458+
455459
#else /* CONFIG_HIBERNATION */
456460
static inline void register_nosave_region(unsigned long b, unsigned long e) {}
457461
static inline int swsusp_page_is_forbidden(struct page *p) { return 0; }

kernel/power/power.h

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,6 @@ extern void __init hibernate_image_size_init(void);
2626
/* Maximum size of architecture specific data in a hibernation header */
2727
#define MAX_ARCH_HEADER_SIZE (sizeof(struct new_utsname) + 4)
2828

29-
extern int arch_hibernation_header_save(void *addr, unsigned int max_size);
30-
extern int arch_hibernation_header_restore(void *addr);
31-
3229
static inline int init_header_complete(struct swsusp_info *info)
3330
{
3431
return arch_hibernation_header_save(info, MAX_ARCH_HEADER_SIZE);
@@ -41,8 +38,6 @@ static inline const char *check_image_kernel(struct swsusp_info *info)
4138
}
4239
#endif /* CONFIG_ARCH_HIBERNATION_HEADER */
4340

44-
extern int hibernate_resume_nonboot_cpu_disable(void);
45-
4641
/*
4742
* Keep some memory free so that I/O operations can succeed without paging
4843
* [Might this be more than 4 MB?]

0 commit comments

Comments
 (0)