From: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
To: "Kirill A. Shutemov" <kirill@shutemov.name>
Cc: lenb@kernel.org, linux-acpi@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] acpi: fix pwr_btn_event_pending build error
Date: Sat, 21 Jul 2012 21:10:38 -0700 [thread overview]
Message-ID: <20120722041038.GN2435@linux.vnet.ibm.com> (raw)
In-Reply-To: <20120722000838.GA15798@shutemov.name>
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 <paul.mckenney@linaro.org>
> > > >
> > > > 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 <paul.mckenney@linaro.org>
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 */
static void acpi_sleep_tts_switch(u32 acpi_state)
{
--
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
WARNING: multiple messages have this Message-ID (diff)
From: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
To: "Kirill A. Shutemov" <kirill@shutemov.name>
Cc: lenb@kernel.org, linux-acpi@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] acpi: fix pwr_btn_event_pending build error
Date: Sat, 21 Jul 2012 21:10:38 -0700 [thread overview]
Message-ID: <20120722041038.GN2435@linux.vnet.ibm.com> (raw)
In-Reply-To: <20120722000838.GA15798@shutemov.name>
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 <paul.mckenney@linaro.org>
> > > >
> > > > 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 <paul.mckenney@linaro.org>
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 */
static void acpi_sleep_tts_switch(u32 acpi_state)
{
next prev parent reply other threads:[~2012-07-22 4:11 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-07-21 21:41 [PATCH] acpi: fix pwr_btn_event_pending build error Paul E. McKenney
2012-07-21 21:41 ` Paul E. McKenney
2012-07-21 21:52 ` Kirill A. Shutemov
2012-07-21 23:37 ` Paul E. McKenney
2012-07-22 0:08 ` Kirill A. Shutemov
2012-07-22 4:10 ` Paul E. McKenney [this message]
2012-07-22 4:10 ` Paul E. McKenney
2012-07-22 17:40 ` Rafael J. Wysocki
2012-07-22 17:40 ` Rafael J. Wysocki
2012-07-22 20:28 ` Paul E. McKenney
2012-07-22 20:28 ` Paul E. McKenney
2012-07-23 18:58 ` Rafael J. Wysocki
2012-07-23 18:58 ` Rafael J. Wysocki
2012-07-23 19:01 ` [Resend][PATCH] ACPI / PM: Fix build warning in sleep.c for CONFIG_ACPI_SLEEP unset Rafael J. Wysocki
2012-07-23 19:29 ` Paul E. McKenney
2012-07-26 23:28 ` Len Brown
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=20120722041038.GN2435@linux.vnet.ibm.com \
--to=paulmck@linux.vnet.ibm.com \
--cc=kirill@shutemov.name \
--cc=lenb@kernel.org \
--cc=linux-acpi@vger.kernel.org \
--cc=linux-kernel@vger.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.