Skip to contentSkip to conversation

acpi: fix pwr_btn_event_pending build error

PATCH In review Paul E. McKenney 4 participants 11 messages Jul 21, 2012 – Jul 26, 2012 ACPI

lore
Share & tools
lore
#0 lore raw

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
index 8856102..18347aa 100644
@@ -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

#1 lore raw
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.

drivers/acpi/sleep.c +0 -0
index 8856102..18347aa 100644

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
#2 lore raw
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.

drivers/acpi/sleep.c +0 -0
index 8856102..18347aa 100644
@@ -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 -0
 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...)

Thanx, Paul

#3 lore raw
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.

drivers/acpi/sleep.c +0 -0
index 8856102..18347aa 100644
@@ -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 -0
 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 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
#4 lore raw
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.

drivers/acpi/sleep.c +0 -0
index 8856102..18347aa 100644

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 ?

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
index 8856102..18347aa 100644
@@ -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

#5 lore raw
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.

drivers/acpi/sleep.c +0 -0
index 8856102..18347aa 100644

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 ?

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

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.

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
Index: 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

--
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

#6 lore raw
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.

drivers/acpi/sleep.c +0 -0
index 8856102..18347aa 100644

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 ?

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:

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.

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 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(-)

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

#7 lore raw
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.

drivers/acpi/sleep.c +0 -0
index 8856102..18347aa 100644

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 ?

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]

Quoted 7 lines
Quoted 5 lines
Quoted 3 lines

This patch silences this error.

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 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(-)

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

#8 lore raw

PATCH RESEND 1/1 ACPI / PM: Fix build warning in sleep.c for CONFIG_ACPI_SLEEP unset

In reply to Paul E. McKenney

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 appropriate #ifdef.

---
 drivers/acpi/sleep.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/acpi/sleep.c +1 -1
Index: 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
author Tested-by on v1 1/1
#9 lore raw

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_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.

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
reviewer Applied
#10 lore raw

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