From patchwork Tue May 16 19:35:42 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 94882 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp659569vqo; Tue, 16 May 2023 12:39:24 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ440JNUC2LYYqWXkbS2iwnYtDc1atNKLf3ZpeE/nIWA6/ofjLHZ0jizOS4S5Zetrjz8zCwd X-Received: by 2002:a17:902:9697:b0:1ac:8db3:d4e3 with SMTP id n23-20020a170902969700b001ac8db3d4e3mr30316122plp.37.1684265964510; Tue, 16 May 2023 12:39:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684265964; cv=none; d=google.com; s=arc-20160816; b=Qjzy0sn3i5qoUaFTwEcHnXNk6608FKZaUG7DfX2Jse/shasWPDUa016ri0z2ngcG// Of860lmvnoDMaInVzTtbtZbHFDXGNJKRo2s16YhXLLdLW6fVWPVlL0gju+Oc2SgB6F0C XAhBAmahyXNzeY497aHSgMXHfHCI4Aa5k1qMzHCZ5NJRiY3bL9wx38WVEdnA5YbuZ6d6 RUlVyCKAc63lyIOljSH5OkdB+HidVJ3/ICv4/TZ/DM5tmFKLZJE8HLHUvcoaA3vbik80 pyIus3t57OberRfIteLbTJGXqQXKKE0594P+DuactCs7IuQUUqarB47EPU01pdOXJBSO KjzQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=M8GYijOSmRcdnArManpJOeJVOpD7CLIw2g+5IDNyeGQ=; b=uXmVO/6wkN7HCDAzgJKD0AhLmkKy+vB1rp8MugZGrsUd4siCmrjMDtZdDU5itfJNf4 PszC4lPc4ResJaUB0F8P+um3Rd3J80ywk6YVPKgZYgaQv+0I/wtFNR+19ez/CVZyUrpf hRGV8JPAAf7r0JrUFnrB7eHV682UedNP5FpwNK3Nd82QuAJVhKXv6bftEbjKcxaV6hOQ C40XXtafzHszXACVaK94vO4ibHS+EXXQGb/NQErzmKS2pkRYocZXOH8vOaxUoc8doUGB PaGD3bhh9otbmdhO4WcbWJEmNTY7o9/2nCnaxh0wbyWKo6syFn+Lau6Tc2yajEoRa7l0 h6lw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=XIN+eFgS; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id e19-20020a170902f1d300b001addf547a59si10786871plc.0.2023.05.16.12.39.12; Tue, 16 May 2023 12:39:24 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=XIN+eFgS; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230185AbjEPTiF (ORCPT + 99 others); Tue, 16 May 2023 15:38:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57674 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230104AbjEPThx (ORCPT ); Tue, 16 May 2023 15:37:53 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 43F8093FA; Tue, 16 May 2023 12:37:29 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 92CDE63EAB; Tue, 16 May 2023 19:37:27 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 57333C4339B; Tue, 16 May 2023 19:37:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1684265847; bh=J5EKXsQ8JpkrI9Gz8p7tvN4WBF349kQdKYOIvFSrsNU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=XIN+eFgSG5axh0khDn+f/DfiFa2fy/Gl7HlqCu4DFGR/Gh/jJBZE6kogRn1pGLSf0 H7p3sJKdHoW15hlgh4PqRp1aSRxoJGu8xkUBD8UOV/7Wc3R0dnNCmKZ0BDGWJZb8D1 oH2yP6PbTSse4jjfW7V1Oui8ScgC+ip8wsTfipPJG3h+KlhBMS7cqSGZFq5vDlKiy0 RswG11Urln0rfwHreMBoCRqO+yKcqFn55K7Ppwg4ukMOh1RtnbSr9DTsibIdx1NEsh DnzXMlfpiLzkeqt66J/wTfnFD+0D1bBh1mk3F7Als3cmaZdCeWg7QJDwUyVhPN3vUW T784GEZx+Ea6A== From: Arnd Bergmann To: x86@kernel.org Cc: Arnd Bergmann , Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , "H. Peter Anvin" , Andy Lutomirski , Steven Rostedt , Masami Hiramatsu , Mark Rutland , Juergen Gross , "Srivatsa S. Bhat (VMware)" , Alexey Makhalov , VMware PV-Drivers Reviewers , Peter Zijlstra , Darren Hart , Andy Shevchenko , Boris Ostrovsky , "Rafael J. Wysocki" , linux-kernel@vger.kernel.org, linux-trace-kernel@vger.kernel.org, virtualization@lists.linux-foundation.org, linux-pci@vger.kernel.org, platform-driver-x86@vger.kernel.org, xen-devel@lists.xenproject.org, linux-pm@vger.kernel.org, linux-mm@kvack.org Subject: [PATCH 13/20] x86: hibernate: declare global functions in suspend.h Date: Tue, 16 May 2023 21:35:42 +0200 Message-Id: <20230516193549.544673-14-arnd@kernel.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230516193549.544673-1-arnd@kernel.org> References: <20230516193549.544673-1-arnd@kernel.org> MIME-Version: 1.0 X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1766080867982639052?= X-GMAIL-MSGID: =?utf-8?q?1766080867982639052?= From: Arnd Bergmann 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 --- include/linux/suspend.h | 4 ++++ kernel/power/power.h | 5 ----- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/include/linux/suspend.h b/include/linux/suspend.h index 7ec73e77e652..bc911fecb8e8 100644 --- a/include/linux/suspend.h +++ b/include/linux/suspend.h @@ -452,6 +452,10 @@ extern struct pbe *restore_pblist; int pfn_is_nosave(unsigned long pfn); int hibernate_quiet_exec(int (*func)(void *data), void *data); +int hibernate_resume_nonboot_cpu_disable(void); +int arch_hibernation_header_save(void *addr, unsigned int max_size); +int arch_hibernation_header_restore(void *addr); + #else /* CONFIG_HIBERNATION */ static inline void register_nosave_region(unsigned long b, unsigned long e) {} static inline int swsusp_page_is_forbidden(struct page *p) { return 0; } diff --git a/kernel/power/power.h b/kernel/power/power.h index b83c8d5e188d..a6a16faf0ead 100644 --- a/kernel/power/power.h +++ b/kernel/power/power.h @@ -26,9 +26,6 @@ extern void __init hibernate_image_size_init(void); /* Maximum size of architecture specific data in a hibernation header */ #define MAX_ARCH_HEADER_SIZE (sizeof(struct new_utsname) + 4) -extern int arch_hibernation_header_save(void *addr, unsigned int max_size); -extern int arch_hibernation_header_restore(void *addr); - static inline int init_header_complete(struct swsusp_info *info) { 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) } #endif /* CONFIG_ARCH_HIBERNATION_HEADER */ -extern int hibernate_resume_nonboot_cpu_disable(void); - /* * Keep some memory free so that I/O operations can succeed without paging * [Might this be more than 4 MB?]