From patchwork Fri Feb 2 14:56:18 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 10196945 X-Patchwork-Delegate: rjw@sisk.pl Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 218486037D for ; Fri, 2 Feb 2018 14:59:00 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1122228E82 for ; Fri, 2 Feb 2018 14:59:00 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 05A5628E90; Fri, 2 Feb 2018 14:59:00 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7253E28E82 for ; Fri, 2 Feb 2018 14:58:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751916AbeBBO66 (ORCPT ); Fri, 2 Feb 2018 09:58:58 -0500 Received: from mout.kundenserver.de ([212.227.126.130]:53657 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751795AbeBBO65 (ORCPT ); Fri, 2 Feb 2018 09:58:57 -0500 Received: from wuerfel.lan ([95.208.111.237]) by mrelayeu.kundenserver.de (mreue007 [212.227.15.129]) with ESMTPA (Nemesis) id 0MeHvO-1eNB9z3uN4-00PtNS; Fri, 02 Feb 2018 15:57:38 +0100 From: Arnd Bergmann To: x86@kernel.org, "Rafael J. Wysocki" , Pavel Machek , Thomas Gleixner , Ingo Molnar , "H. Peter Anvin" , Len Brown Cc: Nicolas Pitre , Andi Kleen , linux-kernel@vger.kernel.org, Arnd Bergmann , Bart Van Assche , linux-pm@vger.kernel.org Subject: [PATCH 2/3] x86: fix swsusp_arch_resume prototype Date: Fri, 2 Feb 2018 15:56:18 +0100 Message-Id: <20180202145634.200291-2-arnd@arndb.de> X-Mailer: git-send-email 2.9.0 In-Reply-To: <20180202145634.200291-1-arnd@arndb.de> References: <20180202145434.100626-1-arnd@arndb.de> <20180202145634.200291-1-arnd@arndb.de> X-Provags-ID: V03:K0:ky5wMEXrnMiWObgBA5KeDBRDcJHbRB63cOR62Dk9Joh5+1tRJC5 CjM86WptwuuIxieB4rxjpSZrBk4iT9feA8Ncizh81R03TOV7sTarb2I1VubutQYQmZ/ZaPG IAXGsKFNLB1yBUkDOZbzx94RHHiX8evSkiWCUQmFW+P8BTi3ouGqkHIUbGbURli/HKwXBS6 ycE1m4L7Z1AQKdtC6kcrw== X-UI-Out-Filterresults: notjunk:1; V01:K0:SOG8ZtnVteE=:N2Ou79kS+dqCc0gWQYsaDU XKvkJH98YLzjTmVW5Ed5hIFcSWwyVZRIeYbhupqeEJUsgclX0zbqT8GxEB8gj+QaU4KTu47Nb vFO9yGVJToocmhXNlX4kNsAHjnWEpTK7S1ssF/hQeZufRDQWlWWEMaJlKfnrouVHulRzXDJxq 6+ZdM1OrOZ0kaVrPPAGqWtD3dp4DE2w0jD6KQ1JzSeaTIX5XgmztKTWJRjMGOwsmI+AYvM4xf pJNFQjWAAXckblzYf6wXFo5lnhqELhvnxJHeM0+ApJlYp4dW3iugB523KBDObmz/Mo9d2O5dZ vl4zH/kTRBRvBhqFk6Libwz5GIYwWHgfiZO6aIgFxALqiZ0vUNYmCWIt6PFcSQiRGoISzmxTL PvRNntWbUrDaHbnimh1LorNjS50190WtaM1+RBpuL9U8GKbkmcjU3pntzq9om+fKvAlaNuGvm gLg3MmF7S9TAjjfZjyqvr2KyjGDmV0pFTdae3bALnKW1hPojyvHtfn06HFkDFl3O0CaIRSUKJ eaeN+QEcMIxXgvoMr85XkUTwtBzpnPYzMeQlb63yuKUbXxuF6Dwl6k1njPh9w8OwGb62AMPzH 6YsMqK80FB9HnPuKtsmGCfobHMo1t/rlQeXTAVgKz/JQfdpURE0sBQGelUWke+p2nPw9F8uFK UnB6Jd2OVS8YQIy1P7Y7fxAJuFv7ZPkA71vuPAiuyHF2r1FEOPeaYbqz5QDCmkAUQ3DvHDOUh 5lr6KZB51m/oaZ9fhZsqB+4PeAwGsGviaFqvsw== Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 --- 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);