From patchwork Tue Nov 7 10:48:44 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 10046397 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 CDA5160360 for ; Tue, 7 Nov 2017 10:51:51 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A880D287C3 for ; Tue, 7 Nov 2017 10:51:51 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9D66D29DB1; Tue, 7 Nov 2017 10:51:51 +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=unavailable 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 14D4D287C3 for ; Tue, 7 Nov 2017 10:51:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753816AbdKGKth (ORCPT ); Tue, 7 Nov 2017 05:49:37 -0500 Received: from mout.kundenserver.de ([212.227.17.10]:56834 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753460AbdKGKt2 (ORCPT ); Tue, 7 Nov 2017 05:49:28 -0500 Received: from wuerfel.lan ([109.193.157.232]) by mrelayeu.kundenserver.de (mreue105 [212.227.15.145]) with ESMTPA (Nemesis) id 0LfBVo-1f0WXb2wG0-00onbC; Tue, 07 Nov 2017 11:49:15 +0100 From: Arnd Bergmann To: "Rafael J. Wysocki" , Len Brown Cc: Paul Menzel , Arnd Bergmann , stable@vger.kernel.org, Jean Delvare , linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] ACPI / PM: fix build regression Date: Tue, 7 Nov 2017 11:48:44 +0100 Message-Id: <20171107104913.3303452-1-arnd@arndb.de> X-Mailer: git-send-email 2.9.0 X-Provags-ID: V03:K0:0GikXRiaDCZMNLZgLo0mANrz1cIZx7+fttgIqhejN2uyy2H+4M/ Iy1yAJW4D2HZw6XEaYC6psTjvZo8Z34/HhP0dN6SQIDHcoHlx3JsOlULD/6a1Xzx3nmKywk +38zeaQpBEVU0HxfHuf9guZc8WKSrTxJAJmcr1wsm9GkJ2XbSs7Vi+NH77J1WdDxLWdjT02 0KLdncrvIkts71jdtN8Dw== X-UI-Out-Filterresults: notjunk:1; V01:K0:YDuoNKDjsJA=:pX3j/Rrk1bAH7Bba8tiF6x 8KQkUDYUTvWEDnNWnQk6sGIAJZEa+Uy7jy0ujbST3e/zrkUyYNlfnGLxI+m5+ZIs+k18Mv3Rb NGqKekCaigeN9ZKEVHet7XfqNbwB0kz5qyUS6wIKjFs+okMw2qMGLQ3QGATzXXXWKJziwOfuf PWzpyiG9nnF81VEQDntTxhlgOsZcoP5v0kxAXBGm2eKh2LJNjPB6zm2uqEr5mQRSsnLd+ssbl f4AIld7W3J9mSpmfYaIDMRpXJee37Sg6UoST6w2AYZcEFUMo8LpwmjJkzrgbiHc4T+kTLb02i cx+mDrIu2ivVJ4wyYvhd6Cpe6ME2Xc/b9Qet1LOXCMWCrG2JrodzVH2MzwXhRb72tmosGxmLl fc/QVuUauM2cvCNDywuonyhiQaomiEf3Yzglu2n2v77S3ra4iBFgFHxkb4JmoNudSASWq6UO0 B6HMeTDG9t95CcYOl0L/coM8NrvHWq8+E+E3nAWCnnRUDXE8lmDIo0dFe6xGtzoJkF5pkfotI BnW2EfQZdqS/rZCdICmAU+N07qEYAZJNB9UlITd4G63dUHmnOOHAMJLIV925/lnqHdbx91TL0 UlimjfkStij/oFctM+mOQIqPD3FHdBJG2jtmdHaYPS8KSb/jFiycblV1zt+yI12juTomsObz4 ClcFholA/7n5dVl8vcrVgVk6pNopKYQp0xsYmrDIf8zbZqsDjteQXOF9rMWkn9R3YU4YMqWgZ pG/GebpEJJs/xICgxZrEocyAO37AXdYgJ3Esag== Sender: linux-acpi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The XPS13 workaround caused a build regression in configurations without CONFIG_ACPI_SLEEP. drivers/acpi/sleep.c:95:5: error: redefinition of 'acpi_target_system_state' u32 acpi_target_system_state(void) ^~~~~~~~~~~~~~~~~~~~~~~~ In file included from include/linux/acpi.h:44:0, from drivers/acpi/sleep.c:20: include/acpi/acpi_bus.h:661:19: note: previous definition of 'acpi_target_system_state' was here static inline u32 acpi_target_system_state(void) { return ACPI_STATE_S0; } ^~~~~~~~~~~~~~~~~~~~~~~~ drivers/acpi/sleep.c:495:13: error: 'acpi_pm_end' defined but not used [-Werror=unused-function] This adds back the #ifdef checks required to make it build cleanly again. The patch that caused the regression is marked for backports to v4.13, the same should apply to this one. Fixes: 8d7a4756fef9 ("ACPI / PM: Blacklist Low Power S0 Idle _DSM for Dell XPS13 9360") Cc: stable@vger.kernel.org Signed-off-by: Arnd Bergmann --- I have not tried to verify that the new version makes sense, only that it builds cleanly. Please have a look and apply either this patch, or whatever else makes more sense here. --- drivers/acpi/sleep.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/acpi/sleep.c b/drivers/acpi/sleep.c index 01ac769e51c9..374f995dbd0a 100644 --- a/drivers/acpi/sleep.c +++ b/drivers/acpi/sleep.c @@ -90,6 +90,7 @@ static bool acpi_sleep_state_supported(u8 sleep_state) && acpi_gbl_FADT.sleep_status.address)); } +#ifdef CONFIG_ACPI_SLEEP static u32 acpi_target_sleep_state = ACPI_STATE_S0; u32 acpi_target_system_state(void) @@ -99,6 +100,7 @@ u32 acpi_target_system_state(void) EXPORT_SYMBOL_GPL(acpi_target_system_state); static bool pwr_btn_event_pending; +#endif /* * The ACPI specification wants us to save NVS memory regions during hibernation @@ -376,6 +378,7 @@ static void __init acpi_sleep_dmi_check(void) dmi_check_system(acpisleep_dmi_table); } +#ifdef CONFIG_ACPI_SLEEP /** * acpi_pm_freeze - Disable the GPEs and suspend EC transactions. */ @@ -503,6 +506,7 @@ static void acpi_pm_end(void) acpi_target_sleep_state = ACPI_STATE_S0; acpi_sleep_tts_switch(acpi_target_sleep_state); } +#endif #ifdef CONFIG_SUSPEND static u32 acpi_suspend_states[] = {