* [PATCH] power: collie_battery: hide unused variable
@ 2016-01-25 15:45 Arnd Bergmann
2016-01-30 16:16 ` Pavel Machek
2016-02-15 5:03 ` Sebastian Reichel
0 siblings, 2 replies; 3+ messages in thread
From: Arnd Bergmann @ 2016-01-25 15:45 UTC (permalink / raw)
To: linux-arm-kernel
The 'wakeup_enabled' variable in this driver is only accessed
by the optional power management functions and we get a warning
when they are disabled:
drivers/power/collie_battery.c:29:12: error: 'wakeup_enabled' defined but not used [-Werror=unused-variable]
This moves the definition next to the users inside the same #ifdef,
which avoids the warning.
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
drivers/power/collie_battery.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/power/collie_battery.c b/drivers/power/collie_battery.c
index 8a971b3dbe58..3a0bc608d4b5 100644
--- a/drivers/power/collie_battery.c
+++ b/drivers/power/collie_battery.c
@@ -26,7 +26,6 @@
static DEFINE_MUTEX(bat_lock); /* protects gpio pins */
static struct work_struct bat_work;
static struct ucb1x00 *ucb;
-static int wakeup_enabled;
struct collie_bat {
int status;
@@ -291,6 +290,8 @@ static struct gpio collie_batt_gpios[] = {
};
#ifdef CONFIG_PM
+static int wakeup_enabled;
+
static int collie_bat_suspend(struct ucb1x00_dev *dev)
{
/* flush all pending status updates */
--
2.7.0
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [PATCH] power: collie_battery: hide unused variable
2016-01-25 15:45 [PATCH] power: collie_battery: hide unused variable Arnd Bergmann
@ 2016-01-30 16:16 ` Pavel Machek
2016-02-15 5:03 ` Sebastian Reichel
1 sibling, 0 replies; 3+ messages in thread
From: Pavel Machek @ 2016-01-30 16:16 UTC (permalink / raw)
To: linux-arm-kernel
On Mon 2016-01-25 16:45:49, Arnd Bergmann wrote:
> The 'wakeup_enabled' variable in this driver is only accessed
> by the optional power management functions and we get a warning
> when they are disabled:
>
> drivers/power/collie_battery.c:29:12: error: 'wakeup_enabled' defined but not used [-Werror=unused-variable]
>
> This moves the definition next to the users inside the same #ifdef,
> which avoids the warning.
>
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Acked-by: Pavel Machek <pavel@ucw.cz>
--
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
^ permalink raw reply [flat|nested] 3+ messages in thread
* [PATCH] power: collie_battery: hide unused variable
2016-01-25 15:45 [PATCH] power: collie_battery: hide unused variable Arnd Bergmann
2016-01-30 16:16 ` Pavel Machek
@ 2016-02-15 5:03 ` Sebastian Reichel
1 sibling, 0 replies; 3+ messages in thread
From: Sebastian Reichel @ 2016-02-15 5:03 UTC (permalink / raw)
To: linux-arm-kernel
Hi,
On Mon, Jan 25, 2016 at 04:45:49PM +0100, Arnd Bergmann wrote:
> The 'wakeup_enabled' variable in this driver is only accessed
> by the optional power management functions and we get a warning
> when they are disabled:
>
> drivers/power/collie_battery.c:29:12: error: 'wakeup_enabled' defined but not used [-Werror=unused-variable]
>
> This moves the definition next to the users inside the same #ifdef,
> which avoids the warning.
Thanks, queued.
-- Sebastian
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20160215/07779cfd/attachment.sig>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2016-02-15 5:03 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-01-25 15:45 [PATCH] power: collie_battery: hide unused variable Arnd Bergmann
2016-01-30 16:16 ` Pavel Machek
2016-02-15 5:03 ` Sebastian Reichel
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).