2008-08-03 13:12:39

by Manish Katiyar

[permalink] [raw]
Subject: [PATCH] resend: Remove warning 'unused variable battery' in drivers/acpi/sbs.c

Resend of the patch to remove the following warning:
drivers/acpi/sbs.c: In function 'acpi_battery_remove':
drivers/acpi/sbs.c:819: warning: unused variable 'battery'


Signed-off-by:- "Manish Katiyar" <[email protected]>

---
drivers/acpi/sbs.c | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/drivers/acpi/sbs.c b/drivers/acpi/sbs.c
index 10a3651..8493603 100644
--- a/drivers/acpi/sbs.c
+++ b/drivers/acpi/sbs.c
@@ -816,7 +816,9 @@ static int acpi_battery_add(struct acpi_sbs *sbs, int id)

static void acpi_battery_remove(struct acpi_sbs *sbs, int id)
{
+#if defined (CONFIG_ACPI_SYSFS_POWER) || (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)
--
1.5.4.3


Thanks -
Manish

On Sun, Aug 3, 2008 at 6:00 PM, Ilpo J?rvinen <[email protected]> wrote:
> On Sun, 3 Aug 2008, Manish Katiyar wrote:
>
>> Below patch removes the following warning:
>> drivers/acpi/sbs.c: In function 'acpi_battery_remove':
>> drivers/acpi/sbs.c:819: warning: unused variable 'battery'
>>
>>
>>
>> Signed-off-by:- "Manish Katiyar" <[email protected]>
>>
>> ---
>> drivers/acpi/sbs.c | 2 ++
>> 1 files changed, 2 insertions(+), 0 deletions(-)
>>
>> diff --git a/drivers/acpi/sbs.c b/drivers/acpi/sbs.c
>> index 10a3651..8493603 100644
>> --- a/drivers/acpi/sbs.c
>> +++ b/drivers/acpi/sbs.c
>> @@ -816,7 +816,9 @@ static int acpi_battery_add(struct acpi_sbs *sbs, int id)
>>
>> static void acpi_battery_remove(struct acpi_sbs *sbs, int id)
>> {
>> +#ifdef CONFIG_ACPI_SYSFS_POWER || CONFIG_ACPI_PROCFS_POWER
>
> I don't think you can use || operator in ifdef like that... ...Try
> #if defined(...) || (...) instead.
>
>
> --
> i.
>


2008-08-03 14:43:38

by Ilpo Järvinen

[permalink] [raw]
Subject: Re: [PATCH] resend: Remove warning 'unused variable battery' in drivers/acpi/sbs.c

On Sun, 3 Aug 2008, Manish Katiyar wrote:

> Resend of the patch to remove the following warning:
> drivers/acpi/sbs.c: In function 'acpi_battery_remove':
> drivers/acpi/sbs.c:819: warning: unused variable 'battery'
>
>
> Signed-off-by:- "Manish Katiyar" <[email protected]>
>
> ---
> drivers/acpi/sbs.c | 2 ++
> 1 files changed, 2 insertions(+), 0 deletions(-)
>
> diff --git a/drivers/acpi/sbs.c b/drivers/acpi/sbs.c
> index 10a3651..8493603 100644
> --- a/drivers/acpi/sbs.c
> +++ b/drivers/acpi/sbs.c
> @@ -816,7 +816,9 @@ static int acpi_battery_add(struct acpi_sbs *sbs, int id)
>
> static void acpi_battery_remove(struct acpi_sbs *sbs, int id)
> {
> +#if defined (CONFIG_ACPI_SYSFS_POWER) || (CONFIG_ACPI_PROCFS_POWER)

Sorry, my bad this time, you actually need to have defined() around both
of the config symbols though I forgot it in one of them in my example
because I was using dots instead of real ones that would have made that
mistake obvious due to capitalization.

> >> +#ifdef CONFIG_ACPI_SYSFS_POWER || CONFIG_ACPI_PROCFS_POWER
> >
> > I don't think you can use || operator in ifdef like that... ...Try
> > #if defined(...) || (...) instead.


--
i.