Skip to content

Commit 589d97b

Browse files
arndbgregkh
authored andcommitted
x86/power: Fix swsusp_arch_resume prototype
[ Upstream commit 328008a ] The declaration for swsusp_arch_resume marks it as 'asmlinkage', but the definition in x86-32 does not, and it fails to include the header with the declaration. This leads to a warning when building with link-time-optimizations: kernel/power/power.h:108:23: error: type of 'swsusp_arch_resume' does not match original declaration [-Werror=lto-type-mismatch] extern asmlinkage int swsusp_arch_resume(void); ^ arch/x86/power/hibernate_32.c:148:0: note: 'swsusp_arch_resume' was previously declared here int swsusp_arch_resume(void) This moves the declaration into a globally visible header file and fixes up both x86 definitions to match it. Signed-off-by: Arnd Bergmann <[email protected]> Signed-off-by: Thomas Gleixner <[email protected]> Cc: Len Brown <[email protected]> Cc: Andi Kleen <[email protected]> Cc: Nicolas Pitre <[email protected]> Cc: [email protected] Cc: "Rafael J. Wysocki" <[email protected]> Cc: Pavel Machek <[email protected]> Cc: Bart Van Assche <[email protected]> Link: https://lkml.kernel.org/r/[email protected] Signed-off-by: Sasha Levin <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent cabf4ef commit 589d97b

File tree

4 files changed

+4
-5
lines changed

4 files changed

+4
-5
lines changed

arch/x86/power/hibernate_32.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ static inline void resume_init_first_level_page_table(pgd_t *pg_dir)
142142
#endif
143143
}
144144

145-
int swsusp_arch_resume(void)
145+
asmlinkage int swsusp_arch_resume(void)
146146
{
147147
int error;
148148

arch/x86/power/hibernate_64.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ static int set_up_temporary_mappings(void)
7878
return 0;
7979
}
8080

81-
int swsusp_arch_resume(void)
81+
asmlinkage int swsusp_arch_resume(void)
8282
{
8383
int error;
8484

include/linux/suspend.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -377,6 +377,8 @@ extern int swsusp_page_is_forbidden(struct page *);
377377
extern void swsusp_set_page_free(struct page *);
378378
extern void swsusp_unset_page_free(struct page *);
379379
extern unsigned long get_safe_page(gfp_t gfp_mask);
380+
extern asmlinkage int swsusp_arch_suspend(void);
381+
extern asmlinkage int swsusp_arch_resume(void);
380382

381383
extern void hibernation_set_ops(const struct platform_hibernation_ops *ops);
382384
extern int hibernate(void);

kernel/power/power.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -85,9 +85,6 @@ extern int in_suspend;
8585
extern dev_t swsusp_resume_device;
8686
extern sector_t swsusp_resume_block;
8787

88-
extern asmlinkage int swsusp_arch_suspend(void);
89-
extern asmlinkage int swsusp_arch_resume(void);
90-
9188
extern int create_basic_memory_bitmaps(void);
9289
extern void free_basic_memory_bitmaps(void);
9390
extern int hibernate_preallocate_memory(void);

0 commit comments

Comments
 (0)