From: Andrew Morton <akpm@linux-foundation.org>
To: Rakib Mullick <rakib.mullick@gmail.com>
Cc: LKML <linux-kernel@vger.kernel.org>, Len Brown <lenb@kernel.org>,
Alexey Starikovskiy <astarikovskiy@suse.de>
Subject: Re: [PATCH] acpi: Fix unused variable warning in sbs.c
Date: Thu, 7 Jan 2010 14:51:26 -0800 [thread overview]
Message-ID: <20100107145126.22271109.akpm@linux-foundation.org> (raw)
In-Reply-To: <b9df5fa11001030527h71b66dbcgd4ef29c04545cdaf@mail.gmail.com>
On Sun, 3 Jan 2010 19:27:56 +0600
Rakib Mullick <rakib.mullick@gmail.com> wrote:
> Fix unused variabled warning.
>
> When CONFIG_ACPI_SYSFS_POWER=n and CONFIG_ACPI_PROCFS_POWER=n, then
> we're warned by the following warning:
>
> drivers/acpi/sbs.c: In function `acpi_battery_remove':
> drivers/acpi/sbs.c:825: warning: unused variable `battery'
>
>
> Signed-off-by: Rakib Mullick <rakib.mullick@gmail.com>
> ---
>
> --- linus/drivers/acpi/sbs.c 2009-12-28 12:37:29.000000000 +0600
> +++ rakib/drivers/acpi/sbs.c 2010-01-03 11:29:07.000000000 +0600
> @@ -822,7 +822,10 @@ static int acpi_battery_add(struct acpi_
>
> static void acpi_battery_remove(struct acpi_sbs *sbs, int id)
> {
> +#if defined(CONFIG_ACPI_SYSFS_POWER) || defined(CONFIG_ACPI_PROCFS_POWER)
> struct acpi_battery *battery = &sbs->battery[id];
> +#endif
> +
> #ifdef CONFIG_ACPI_SYSFS_POWER
> if (battery->bat.dev) {
> if (battery->have_sysfs_alarm)
Rather an unpleasant patch to a rather unpleasant function :( Oh well,
it's better than a warning.
I wonder if it can be fixed in Kconfig. Is there any sane use of
this code when CONFIG_ACPI_SYSFS_POWER=n && CONFIG_ACPI_PROCFS_POWER=n?
next prev parent reply other threads:[~2010-01-07 22:52 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-01-03 13:27 [PATCH] acpi: Fix unused variable warning in sbs.c Rakib Mullick
2010-01-07 22:51 ` Andrew Morton [this message]
2010-01-08 7:04 ` Rakib Mullick
2010-01-09 14:04 ` Alexey Starikovskiy
2010-01-16 21:03 ` 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=20100107145126.22271109.akpm@linux-foundation.org \
--to=akpm@linux-foundation.org \
--cc=astarikovskiy@suse.de \
--cc=lenb@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=rakib.mullick@gmail.com \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox