Skip to content

Commit 328008a

Browse files
arndbKAGA-KOKO
authored andcommitted
x86/power: Fix swsusp_arch_resume prototype
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]
1 parent ebfc150 commit 328008a

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
@@ -145,7 +145,7 @@ static inline void resume_init_first_level_page_table(pgd_t *pg_dir)
145145
#endif
146146
}
147147

148-
int swsusp_arch_resume(void)
148+
asmlinkage int swsusp_arch_resume(void)
149149
{
150150
int error;
151151

arch/x86/power/hibernate_64.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ static int relocate_restore_code(void)
174174
return 0;
175175
}
176176

177-
int swsusp_arch_resume(void)
177+
asmlinkage int swsusp_arch_resume(void)
178178
{
179179
int error;
180180

include/linux/suspend.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -384,6 +384,8 @@ extern int swsusp_page_is_forbidden(struct page *);
384384
extern void swsusp_set_page_free(struct page *);
385385
extern void swsusp_unset_page_free(struct page *);
386386
extern unsigned long get_safe_page(gfp_t gfp_mask);
387+
extern asmlinkage int swsusp_arch_suspend(void);
388+
extern asmlinkage int swsusp_arch_resume(void);
387389

388390
extern void hibernation_set_ops(const struct platform_hibernation_ops *ops);
389391
extern int hibernate(void);

kernel/power/power.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -104,9 +104,6 @@ extern int in_suspend;
104104
extern dev_t swsusp_resume_device;
105105
extern sector_t swsusp_resume_block;
106106

107-
extern asmlinkage int swsusp_arch_suspend(void);
108-
extern asmlinkage int swsusp_arch_resume(void);
109-
110107
extern int create_basic_memory_bitmaps(void);
111108
extern void free_basic_memory_bitmaps(void);
112109
extern int hibernate_preallocate_memory(void);

0 commit comments

Comments
 (0)