From patchwork Sun Jul 22 17:40:51 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Rafael Wysocki X-Patchwork-Id: 1224911 Return-Path: X-Original-To: patchwork-linux-acpi@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork2.kernel.org (Postfix) with ESMTP id 22996E0039 for ; Sun, 22 Jul 2012 17:35:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752249Ab2GVRfL (ORCPT ); Sun, 22 Jul 2012 13:35:11 -0400 Received: from ogre.sisk.pl ([193.178.161.156]:51503 "EHLO ogre.sisk.pl" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752226Ab2GVRfK convert rfc822-to-8bit (ORCPT ); Sun, 22 Jul 2012 13:35:10 -0400 Received: from localhost (localhost.localdomain [127.0.0.1]) by ogre.sisk.pl (Postfix) with ESMTP id 2B43B1D98A8; Sun, 22 Jul 2012 19:30:11 +0200 (CEST) Received: from ogre.sisk.pl ([127.0.0.1]) by localhost (ogre.sisk.pl [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 08898-06; Sun, 22 Jul 2012 19:30:01 +0200 (CEST) Received: from ferrari.rjw.lan (62-121-64-87.home.aster.pl [62.121.64.87]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by ogre.sisk.pl (Postfix) with ESMTP id 155FF1D9427; Sun, 22 Jul 2012 19:30:01 +0200 (CEST) From: "Rafael J. Wysocki" To: paulmck@linux.vnet.ibm.com Subject: Re: [PATCH] acpi: fix pwr_btn_event_pending build error Date: Sun, 22 Jul 2012 19:40:51 +0200 User-Agent: KMail/1.13.6 (Linux/3.5.0-rc5+; KDE/4.6.0; x86_64; ; ) Cc: "Kirill A. Shutemov" , lenb@kernel.org, linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org References: <20120721214156.GA2515@linux.vnet.ibm.com> <20120722000838.GA15798@shutemov.name> <20120722041038.GN2435@linux.vnet.ibm.com> In-Reply-To: <20120722041038.GN2435@linux.vnet.ibm.com> MIME-Version: 1.0 Message-Id: <201207221940.51764.rjw@sisk.pl> X-Virus-Scanned: amavisd-new at ogre.sisk.pl using MkS_Vir for Linux Sender: linux-acpi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org On Sunday, July 22, 2012, Paul E. McKenney wrote: > On Sun, Jul 22, 2012 at 03:08:40AM +0300, Kirill A. Shutemov wrote: > > On Sat, Jul 21, 2012 at 04:37:14PM -0700, Paul E. McKenney wrote: > > > On Sun, Jul 22, 2012 at 12:52:43AM +0300, Kirill A. Shutemov wrote: > > > > On Sat, Jul 21, 2012 at 02:41:56PM -0700, Paul E. McKenney wrote: > > > > > Hello! > > > > > > > > > > A recent build for KVM on x86 resulted in the following build error: > > > > > > > > > > drivers/acpi/sleep.c:60:13: warning: ‘pwr_btn_event_pending’ defined but not > > > > > +used [-Wunused-variable] > > > > > > > > > > This patch silences this error. > > > > > > > > > > Signed-off-by: Paul E. McKenney > > > > > > > > > > diff --git a/drivers/acpi/sleep.c b/drivers/acpi/sleep.c > > > > > index 8856102..18347aa 100644 > > > > > --- a/drivers/acpi/sleep.c > > > > > +++ b/drivers/acpi/sleep.c > > > > > @@ -57,7 +57,9 @@ MODULE_PARM_DESC(gts, "Enable evaluation of _GTS on suspend."); > > > > > MODULE_PARM_DESC(bfs, "Enable evaluation of _BFS on resume".); > > > > > > > > > > static u8 sleep_states[ACPI_S_STATE_COUNT]; > > > > > +#ifdef CONFIG_ACPI_SLEEP > > > > > static bool pwr_btn_event_pending; > > > > > +#endif /* #ifdef CONFIG_ACPI_SLEEP */ > > > > > > > > __maybe_unused ? > > > > > > Are the compiler and linker smart enough to get rid of the storage in > > > case it really isn't used? (Not that the storage for a bool is worth > > > worrying about, but...) > > > > GCC with optimization enabled will get rid of the storage even without > > __maybe_unused. > > OK, that should allow me to get rid of a few ifdefs, then! For this one, > please see below. > > Thanx, Paul > > ------------------------------------------------------------------------ > > acpi: fix pwr_btn_event_pending build error > > A recent build for KVM on x86 resulted in the following build error: > > drivers/acpi/sleep.c:60:13: warning: ‘pwr_btn_event_pending’ defined but not > +used [-Wunused-variable] > > This patch silences this error. > > Signed-off-by: Paul E. McKenney Well, I prefer the one below. Thanks, Rafael --- From: Rafael J. Wysocki Subject: ACPI / PM: Fix build warning in sleep.c for CONFIG_ACPI_SLEEP unset If CONFIG_ACPI_SLEEP is unset, the compiler complains that pwr_btn_event_pending is defined but not used. To silence the warning, move the definition of pwr_btn_event_pending under an apprporiate #ifdef. Reported-by: Paul E. McKenney Signed-off-by: Rafael J. Wysocki --- drivers/acpi/sleep.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- To unsubscribe from this list: send the line "unsubscribe linux-acpi" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Index: linux/drivers/acpi/sleep.c =================================================================== --- linux.orig/drivers/acpi/sleep.c +++ linux/drivers/acpi/sleep.c @@ -57,7 +57,6 @@ MODULE_PARM_DESC(gts, "Enable evaluation MODULE_PARM_DESC(bfs, "Enable evaluation of _BFS on resume".); static u8 sleep_states[ACPI_S_STATE_COUNT]; -static bool pwr_btn_event_pending; static void acpi_sleep_tts_switch(u32 acpi_state) { @@ -110,6 +109,7 @@ static int acpi_sleep_prepare(u32 acpi_s #ifdef CONFIG_ACPI_SLEEP static u32 acpi_target_sleep_state = ACPI_STATE_S0; +static bool pwr_btn_event_pending; /* * The ACPI specification wants us to save NVS memory regions during hibernation