* [PATCH] resend: Remove warning 'unused variable battery' in drivers/acpi/sbs.c
@ 2008-08-03 13:24 ` Manish Katiyar
0 siblings, 0 replies; 9+ messages in thread
From: Manish Katiyar @ 2008-08-03 13:12 UTC (permalink / raw)
To: Ilpo Järvinen; +Cc: kernel-janitors, astarikovskiy, LKML, trivial
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" <mkatiyar@gmail.com>
---
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 <ilpo.jarvinen@helsinki.fi> 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" <mkatiyar@gmail.com>
>>
>> ---
>> 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.
>
^ permalink raw reply related [flat|nested] 9+ messages in thread
* [PATCH] resend: Remove warning 'unused variable battery' in drivers/acpi/sbs.c
@ 2008-08-03 13:24 ` Manish Katiyar
0 siblings, 0 replies; 9+ messages in thread
From: Manish Katiyar @ 2008-08-03 13:24 UTC (permalink / raw)
To: Ilpo Järvinen; +Cc: kernel-janitors, astarikovskiy, LKML, trivial
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" <mkatiyar@gmail.com>
---
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 <ilpo.jarvinen@helsinki.fi> 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" <mkatiyar@gmail.com>
>>
>> ---
>> 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.
>
--
To unsubscribe from this list: send the line "unsubscribe kernel-janitors" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply related [flat|nested] 9+ messages in thread
* Re: [PATCH] resend: Remove warning 'unused variable battery' in
2008-08-03 13:24 ` Manish Katiyar
@ 2008-08-03 14:43 ` Ilpo Järvinen
-1 siblings, 0 replies; 9+ messages in thread
From: Ilpo Järvinen @ 2008-08-03 14:43 UTC (permalink / raw)
To: Manish Katiyar; +Cc: kernel-janitors, astarikovskiy, LKML, trivial
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" <mkatiyar@gmail.com>
>
> ---
> 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.
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH] resend: Remove warning 'unused variable battery' in drivers/acpi/sbs.c
@ 2008-08-03 14:43 ` Ilpo Järvinen
0 siblings, 0 replies; 9+ messages in thread
From: Ilpo Järvinen @ 2008-08-03 14:43 UTC (permalink / raw)
To: Manish Katiyar; +Cc: kernel-janitors, astarikovskiy, LKML, trivial
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" <mkatiyar@gmail.com>
>
> ---
> 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.
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH] resend: Remove warning 'unused variable battery' in
2008-08-03 13:24 ` Manish Katiyar
(?)
(?)
@ 2008-08-03 15:12 ` Ilpo Järvinen
-1 siblings, 0 replies; 9+ messages in thread
From: Ilpo Järvinen @ 2008-08-03 15:12 UTC (permalink / raw)
To: kernel-janitors
On Sun, 3 Aug 2008, Manish Katiyar wrote:
> >> 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.
>
> Sorry... I didn't understand :-( ....... I compile tested the patch.
There are plenty of examples available:
$ git-grep '\#if.*||'
...
--
i.
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH] resend: Remove warning 'unused variable battery' in drivers/acpi/sbs.c
2008-08-03 13:24 ` Manish Katiyar
` (2 preceding siblings ...)
(?)
@ 2008-08-03 15:18 ` Manish Katiyar
-1 siblings, 0 replies; 9+ messages in thread
From: Manish Katiyar @ 2008-08-03 15:18 UTC (permalink / raw)
To: kernel-janitors
On Sun, Aug 3, 2008 at 8:13 PM, Ilpo Järvinen <ilpo.jarvinen@helsinki.fi> wrote:
> 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" <mkatiyar@gmail.com>
>>
>> ---
>> 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.
Sorry... I didn't understand :-( ....... I compile tested the patch.
Thanks
>
>> >> +#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.
>
--
To unsubscribe from this list: send the line "unsubscribe kernel-janitors" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH] resend: Remove warning 'unused variable battery' in drivers/acpi/sbs.c
2008-08-03 13:24 ` Manish Katiyar
` (3 preceding siblings ...)
(?)
@ 2008-08-03 15:31 ` Manish Katiyar
-1 siblings, 0 replies; 9+ messages in thread
From: Manish Katiyar @ 2008-08-03 15:31 UTC (permalink / raw)
To: kernel-janitors
On Sun, Aug 3, 2008 at 8:42 PM, Ilpo Järvinen <ilpo.jarvinen@helsinki.fi> wrote:
> On Sun, 3 Aug 2008, Manish Katiyar wrote:
>
>> >> 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.
>>
>> Sorry... I didn't understand :-( ....... I compile tested the patch.
>
> There are plenty of examples available:
Ohh Ok.. got it. Here is an updated patch.
Signed-off-by:- "Manish Katiyar" <mkatiyar@gmail.com>
---
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) || 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)
--
1.5.4.3
>
> $ git-grep '\#if.*||'
> ...
>
>
> --
> i.
>
--
To unsubscribe from this list: send the line "unsubscribe kernel-janitors" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply related [flat|nested] 9+ messages in thread
* Re: [PATCH] resend: Remove warning 'unused variable battery' in drivers/acpi/sbs.c
2008-08-03 13:24 ` Manish Katiyar
` (4 preceding siblings ...)
(?)
@ 2008-08-03 15:31 ` walter harms
-1 siblings, 0 replies; 9+ messages in thread
From: walter harms @ 2008-08-03 15:31 UTC (permalink / raw)
To: kernel-janitors
Manish Katiyar wrote:
> On Sun, Aug 3, 2008 at 8:42 PM, Ilpo Järvinen <ilpo.jarvinen@helsinki.fi> wrote:
>> On Sun, 3 Aug 2008, Manish Katiyar wrote:
>>
>>>>> 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.
>>> Sorry... I didn't understand :-( ....... I compile tested the patch.
>> There are plenty of examples available:
>
> Ohh Ok.. got it. Here is an updated patch.
>
>
> Signed-off-by:- "Manish Katiyar" <mkatiyar@gmail.com>
>
> ---
> 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) || 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)
i suggest to move the #ifdef CONFIG_ACPI_SYSFS_POWER a few lines up, just to improve
readability for me. I did not dive into the code just the patch but i suspect the whole
function depends on CONFIG_ACPI_SYSFS_POWER.
#if defined(CONFIG_ACPI_SYSFS_POWER)
#if defined(CONFIG_ACPI_PROCFS_POWER)
struct acpi_battery *battery = &sbs->battery[id];
#endif
if (battery->bat.dev) {
if (battery->have_sysfs_alarm)
happy hacking,
wh
--
To unsubscribe from this list: send the line "unsubscribe kernel-janitors" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH] resend: Remove warning 'unused variable battery' in drivers/acpi/sbs.c
2008-08-03 13:24 ` Manish Katiyar
` (5 preceding siblings ...)
(?)
@ 2008-08-04 13:23 ` Manish Katiyar
-1 siblings, 0 replies; 9+ messages in thread
From: Manish Katiyar @ 2008-08-04 13:23 UTC (permalink / raw)
To: kernel-janitors
On Sun, Aug 3, 2008 at 9:01 PM, walter harms <wharms@bfs.de> wrote:
>
>
> Manish Katiyar wrote:
>
>> On Sun, Aug 3, 2008 at 8:42 PM, Ilpo Järvinen <ilpo.jarvinen@helsinki.fi> wrote:
>>> On Sun, 3 Aug 2008, Manish Katiyar wrote:
>>>
>>>>>> 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.
>>>> Sorry... I didn't understand :-( ....... I compile tested the patch.
>>> There are plenty of examples available:
>>
>> Ohh Ok.. got it. Here is an updated patch.
>>
>>
>> Signed-off-by:- "Manish Katiyar" <mkatiyar@gmail.com>
>>
>> ---
>> 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) || 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)
>
>
> i suggest to move the #ifdef CONFIG_ACPI_SYSFS_POWER a few lines up, just to improve
> readability for me. I did not dive into the code just the patch but i suspect the whole
> function depends on CONFIG_ACPI_SYSFS_POWER.
Hi Walter,
From the code it looks like they are separate config options and are
independant, but I am too novice to say that :-) .
Thanks -
Manish
>
> #if defined(CONFIG_ACPI_SYSFS_POWER)
>
> #if defined(CONFIG_ACPI_PROCFS_POWER)
> struct acpi_battery *battery = &sbs->battery[id];
> #endif
>
> if (battery->bat.dev) {
> if (battery->have_sysfs_alarm)
>
>
>
> happy hacking,
> wh
>
>
>
>
--
To unsubscribe from this list: send the line "unsubscribe kernel-janitors" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2008-08-04 13:23 UTC | newest]
Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-08-03 13:12 [PATCH] resend: Remove warning 'unused variable battery' in drivers/acpi/sbs.c Manish Katiyar
2008-08-03 13:24 ` Manish Katiyar
2008-08-03 14:43 ` [PATCH] resend: Remove warning 'unused variable battery' in Ilpo Järvinen
2008-08-03 14:43 ` [PATCH] resend: Remove warning 'unused variable battery' in drivers/acpi/sbs.c Ilpo Järvinen
2008-08-03 15:12 ` [PATCH] resend: Remove warning 'unused variable battery' in Ilpo Järvinen
2008-08-03 15:18 ` [PATCH] resend: Remove warning 'unused variable battery' in drivers/acpi/sbs.c Manish Katiyar
2008-08-03 15:31 ` Manish Katiyar
2008-08-03 15:31 ` walter harms
2008-08-04 13:23 ` Manish Katiyar
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.