mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Rafael J. Wysocki" <rjw@rjwysocki.net>
To: Arnd Bergmann <arnd@arndb.de>
Cc: x86@kernel.org, Pavel Machek <pavel@ucw.cz>,
	Thomas Gleixner <tglx@linutronix.de>,
	Ingo Molnar <mingo@redhat.com>, "H. Peter Anvin" <hpa@zytor.com>,
	Len Brown <len.brown@intel.com>, Nicolas Pitre <nico@linaro.org>,
	Andi Kleen <ak@linux.intel.com>,
	linux-kernel@vger.kernel.org,
	Bart Van Assche <bart.vanassche@wdc.com>,
	linux-pm@vger.kernel.org
Subject: Re: [PATCH 2/3] x86: fix swsusp_arch_resume prototype
Date: Thu, 08 Feb 2018 11:12:38 +0100	[thread overview]
Message-ID: <2199353.ODa2DYVeeo@aspire.rjw.lan> (raw)
In-Reply-To: <20180202145634.200291-2-arnd@arndb.de>

On Friday, February 2, 2018 3:56:18 PM CET Arnd Bergmann wrote:
> 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 <arnd@arndb.de>
> ---
>  arch/x86/power/hibernate_32.c | 2 +-
>  arch/x86/power/hibernate_64.c | 2 +-
>  include/linux/suspend.h       | 2 ++
>  kernel/power/power.h          | 3 ---
>  4 files changed, 4 insertions(+), 5 deletions(-)
> 
> diff --git a/arch/x86/power/hibernate_32.c b/arch/x86/power/hibernate_32.c
> index c35fdb585c68..afc4ed7b1578 100644
> --- a/arch/x86/power/hibernate_32.c
> +++ b/arch/x86/power/hibernate_32.c
> @@ -145,7 +145,7 @@ static inline void resume_init_first_level_page_table(pgd_t *pg_dir)
>  #endif
>  }
>  
> -int swsusp_arch_resume(void)
> +asmlinkage int swsusp_arch_resume(void)
>  {
>  	int error;
>  
> diff --git a/arch/x86/power/hibernate_64.c b/arch/x86/power/hibernate_64.c
> index f910c514438f..0ef5e5204968 100644
> --- a/arch/x86/power/hibernate_64.c
> +++ b/arch/x86/power/hibernate_64.c
> @@ -174,7 +174,7 @@ static int relocate_restore_code(void)
>  	return 0;
>  }
>  
> -int swsusp_arch_resume(void)
> +asmlinkage int swsusp_arch_resume(void)
>  {
>  	int error;
>  
> diff --git a/include/linux/suspend.h b/include/linux/suspend.h
> index cc22a24516d6..440b62f7502e 100644
> --- a/include/linux/suspend.h
> +++ b/include/linux/suspend.h
> @@ -384,6 +384,8 @@ extern int swsusp_page_is_forbidden(struct page *);
>  extern void swsusp_set_page_free(struct page *);
>  extern void swsusp_unset_page_free(struct page *);
>  extern unsigned long get_safe_page(gfp_t gfp_mask);
> +extern asmlinkage int swsusp_arch_suspend(void);
> +extern asmlinkage int swsusp_arch_resume(void);
>  
>  extern void hibernation_set_ops(const struct platform_hibernation_ops *ops);
>  extern int hibernate(void);
> diff --git a/kernel/power/power.h b/kernel/power/power.h
> index f29cd178df90..9e58bdc8a562 100644
> --- a/kernel/power/power.h
> +++ b/kernel/power/power.h
> @@ -104,9 +104,6 @@ extern int in_suspend;
>  extern dev_t swsusp_resume_device;
>  extern sector_t swsusp_resume_block;
>  
> -extern asmlinkage int swsusp_arch_suspend(void);
> -extern asmlinkage int swsusp_arch_resume(void);
> -
>  extern int create_basic_memory_bitmaps(void);
>  extern void free_basic_memory_bitmaps(void);
>  extern int hibernate_preallocate_memory(void);
> 

Applied, thanks!

  parent reply	other threads:[~2018-02-08 10:14 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-02-02 14:54 [PATCH 0/3] x86 bugfixes for LTO Arnd Bergmann
2018-02-02 14:56 ` [PATCH 1/3] x86: dumpstack: avoid uninitlized variable Arnd Bergmann
2018-02-02 14:56   ` [PATCH 2/3] x86: fix swsusp_arch_resume prototype Arnd Bergmann
2018-02-02 22:37     ` [tip:x86/urgent] x86/power: Fix " tip-bot for Arnd Bergmann
2018-02-08 10:12     ` Rafael J. Wysocki [this message]
2018-02-02 14:56   ` [PATCH 3/3] x86: error_inject: make just_return_func globally visible Arnd Bergmann
2018-02-03 13:21     ` Masami Hiramatsu
2018-02-13 15:25     ` [tip:x86/urgent] x86/error_inject: Make just_return_func() " tip-bot for Arnd Bergmann
2018-02-02 22:36   ` [tip:x86/urgent] x86/dumpstack: Avoid uninitlized variable tip-bot for Arnd Bergmann
2018-02-05 21:21     ` Arnd Bergmann
2018-02-05 21:39       ` Josh Poimboeuf
2018-02-05 21:48         ` Arnd Bergmann
2018-02-09 22:24 ` [PATCH 0/3] x86 bugfixes for LTO Chris Wilson
2018-02-09 23:00   ` Andi Kleen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=2199353.ODa2DYVeeo@aspire.rjw.lan \
    --to=rjw@rjwysocki.net \
    --cc=ak@linux.intel.com \
    --cc=arnd@arndb.de \
    --cc=bart.vanassche@wdc.com \
    --cc=hpa@zytor.com \
    --cc=len.brown@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=nico@linaro.org \
    --cc=pavel@ucw.cz \
    --cc=tglx@linutronix.de \
    --cc=x86@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome