acpi: fix pwr_btn_event_pending build error
PATCH 1/1 acpi: fix pwr_btn_event_pending build error
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.
drivers/acpi/sleep.c +2 -0
@@ -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 [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Quoted 16 lines · Paul E. McKenney
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 <[email protected]>drivers/acpi/sleep.c +0
-0
drivers/acpi/sleep.c MODULE_PARM_DESC(gts, "Enable evaluation of _GTS on suspend."); · line 62
Quoted 6 lines
drivers/acpi/sleep.c +2
-0@@ -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 ?
Signature · 1 line
Kirill A. Shutemov
Quoted 19 lines · Kirill A. Shutemov
Quoted 18 lines · Paul E. McKenney
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 <[email protected]>drivers/acpi/sleep.c +0
-0@@ -57,7 +57,9 @@ MODULE_PARM_DESC(gts, "Enable evaluation of _GTS on suspend."); MODULE_PARM_DESC(bfs, "Enable evaluation of _BFS on resume".);
Quoted 6 lines
drivers/acpi/sleep.c MODULE_PARM_DESC(gts, "Enable evaluation of _GTS on suspend."); · line 62
Quoted 4 lines
drivers/acpi/sleep.c +2
-0static 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...)
Thanx, Paul
Quoted 27 lines · Paul E. McKenney
Quoted 19 lines · Kirill A. Shutemov
Quoted 18 lines · Paul E. McKenney
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 <[email protected]>drivers/acpi/sleep.c +0
-0@@ -57,7 +57,9 @@ MODULE_PARM_DESC(gts, "Enable evaluation of _GTS on suspend."); MODULE_PARM_DESC(bfs, "Enable evaluation of _BFS on resume".);Quoted 6 lines
drivers/acpi/sleep.c MODULE_PARM_DESC(gts, "Enable evaluation of _GTS on suspend."); · line 62
Quoted 4 lines
drivers/acpi/sleep.c +2
-0static u8 sleep_states[ACPI_S_STATE_COUNT ]; +#ifdef CONFIG_ACPI_SLEEP static bool pwr_btn_event_pending; +#endif /* #ifdef CONFIG_ACPI_SLEEP */
__maybe_unused?
Quoted 3 lines
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.
Signature · 1 line
Kirill A. Shutemov
Quoted 28 lines · Kirill A. Shutemov
Quoted 27 lines · Paul E. McKenney
Quoted 25 lines · Kirill A. Shutemov
Quoted 16 lines · Paul E. McKenney
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 <[email protected]>drivers/acpi/sleep.c +0
-0drivers/acpi/sleep.c MODULE_PARM_DESC(gts, "Enable evaluation of _GTS on suspend."); · line 62
Quoted 6 lines
drivers/acpi/sleep.c +2
-0@@ -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?
Quoted 6 lines
Quoted 3 lines
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.
drivers/acpi/sleep.c +2 -0
@@ -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 [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Quoted 45 lines · Paul E. McKenney
Quoted 28 lines · Kirill A. Shutemov
Quoted 27 lines · Paul E. McKenney
Quoted 25 lines · Kirill A. Shutemov
Quoted 16 lines · Paul E. McKenney
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 <[email protected]>drivers/acpi/sleep.c +0
-0drivers/acpi/sleep.c MODULE_PARM_DESC(gts, "Enable evaluation of _GTS on suspend."); · line 62
Quoted 6 lines
drivers/acpi/sleep.c +2
-0@@ -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?Quoted 6 lines
Quoted 3 lines
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_pendingbuild error
Quoted 8 lines
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 <[email protected]>
Well, I prefer the one below.
Thanks,
Rafael
---
From: Rafael J. Wysocki <[email protected]>
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.
--- drivers/acpi/sleep.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/acpi/sleep.c +1 -1
@@ -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
--
To unsubscribe from this list: send the line "unsubscribe linux-acpi" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Quoted 48 lines · Rafael J. Wysocki
Quoted 47 lines · Paul E. McKenney
Quoted 28 lines · Kirill A. Shutemov
Quoted 27 lines · Paul E. McKenney
Quoted 25 lines · Kirill A. Shutemov
Quoted 16 lines · Paul E. McKenney
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 <[email protected]>drivers/acpi/sleep.c +0
-0drivers/acpi/sleep.c MODULE_PARM_DESC(gts, "Enable evaluation of _GTS on suspend."); · line 62
Quoted 6 lines
drivers/acpi/sleep.c +2
-0@@ -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?Quoted 6 lines
Quoted 3 lines
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_pendingbuild errorA recent build for KVM on x86 resulted in the following build error:
Quoted 8 lines
Quoted 6 lines
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 <[email protected]>Well, I prefer the one below.
Works for me!
Thanx, Paul
Quoted 32 lines
Thanks,
Rafael---
From: Rafael J. Wysocki <[email protected]>
Subject: ACPI / PM: Fix build warning insleep.cforCONFIG_ACPI_SLEEPunsetIf
CONFIG_ACPI_SLEEPis unset, the compiler complains thatpwr_btn_event_pendingis defined but not used. To silence the warning, move the definition ofpwr_btn_event_pendingunder an apprporiate #ifdef.Reported-by Paul E. McKenney <[email protected]>Signed-off-by Rafael J. Wysocki <[email protected]>--- drivers/acpi/sleep.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)Index:
linux/drivers/acpi/sleep.c
===================================================================drivers/acpi/sleep.c +0
-1@@ -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) {
drivers/acpi/sleep.c static int acpi_sleep_prepare(u32 acpi_s · line 115
Quoted 7 lines
drivers/acpi/sleep.c +1
-0@@ -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
--
To unsubscribe from this list: send the line "unsubscribe linux-acpi" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Quoted 52 lines · Paul E. McKenney
Quoted 51 lines · Rafael J. Wysocki
Quoted 50 lines · Paul E. McKenney
Quoted 28 lines · Kirill A. Shutemov
Quoted 27 lines · Paul E. McKenney
Quoted 25 lines · Kirill A. Shutemov
Quoted 16 lines · Paul E. McKenney
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 <[email protected]>drivers/acpi/sleep.c +0
-0drivers/acpi/sleep.c MODULE_PARM_DESC(gts, "Enable evaluation of _GTS on suspend."); · line 62
Quoted 6 lines
drivers/acpi/sleep.c +2
-0@@ -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?Quoted 6 lines
Quoted 3 lines
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_pendingbuild errorA 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]
Quoted 7 lines
Quoted 5 lines
Quoted 3 lines
This patch silences this error.
Signed-off-by Paul E. McKenney <[email protected]>Well, I prefer the one below.
Works for me!
Cool. :-)
I'll resend it just in case there was some confusion somewhere.
Thanks,
Rafael
Quoted 29 lines
Quoted 29 lines
---
From: Rafael J. Wysocki <[email protected]>
Subject: ACPI / PM: Fix build warning insleep.cforCONFIG_ACPI_SLEEPunsetIf
CONFIG_ACPI_SLEEPis unset, the compiler complains thatpwr_btn_event_pendingis defined but not used. To silence the warning, move the definition ofpwr_btn_event_pendingunder an apprporiate #ifdef.Reported-by Paul E. McKenney <[email protected]>Signed-off-by Rafael J. Wysocki <[email protected]>--- drivers/acpi/sleep.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)Index:
linux/drivers/acpi/sleep.c
===================================================================drivers/acpi/sleep.c +0
-1@@ -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
Quoted 10 lines
drivers/acpi/sleep.c static int acpi_sleep_prepare(u32 acpi_s · line 115
Quoted 7 lines
drivers/acpi/sleep.c +1
-0#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
--
To unsubscribe from this list: send the line "unsubscribe linux-acpi" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
PATCH RESEND 1/1 ACPI / PM: Fix build warning in sleep.c for CONFIG_ACPI_SLEEP unset
In reply to Paul E. McKenneyIf 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 appropriate #ifdef.
--- drivers/acpi/sleep.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/acpi/sleep.c +1 -1
@@ -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
Re: [Resend][PATCH] ACPI / PM: Fix build warning in sleep.c for CONFIG_ACPI_SLEEP unset
Quoted 8 lines · Rafael J. Wysocki
If
CONFIG_ACPI_SLEEPis unset, the compiler complains thatpwr_btn_event_pendingis defined but not used. To silence the warning, move the definition ofpwr_btn_event_pendingunder an appropriate #ifdef.Reported-by Paul E. McKenney <[email protected]>Signed-off-by Rafael J. Wysocki <[email protected]>
Quoted 25 lines
--- drivers/acpi/sleep.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)Index:
linux/drivers/acpi/sleep.c
===================================================================drivers/acpi/sleep.c +1
-1@@ -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
Re: [Resend][PATCH] ACPI / PM: Fix build warning in sleep.c for CONFIG_ACPI_SLEEP unset
Applied.
thanks,
Len Brown, Intel Open Source Technology Center