2022-07-19 03:02:51

by Tom Rix

[permalink] [raw]
Subject: [PATCH] power: supply: ab8500: remove unused static local variable

cpp_check reports
[drivers/power/supply/ab8500_chargalg.c:493]: (style) Variable 'ab8500_chargalg_ex_ac_enable_toggle' is assigned a value that is never used.

From inspection, this variable is never used. So remove it.

Fixes: 6c50a08d9dd3 ("power: supply: ab8500: Drop external charger leftovers")
Signed-off-by: Tom Rix <[email protected]>
---
drivers/power/supply/ab8500_chargalg.c | 2 --
1 file changed, 2 deletions(-)

diff --git a/drivers/power/supply/ab8500_chargalg.c b/drivers/power/supply/ab8500_chargalg.c
index ae4be553f424..05146d436a6a 100644
--- a/drivers/power/supply/ab8500_chargalg.c
+++ b/drivers/power/supply/ab8500_chargalg.c
@@ -490,8 +490,6 @@ static int ab8500_chargalg_kick_watchdog(struct ab8500_chargalg *di)
static int ab8500_chargalg_ac_en(struct ab8500_chargalg *di, int enable,
int vset_uv, int iset_ua)
{
- static int ab8500_chargalg_ex_ac_enable_toggle;
-
if (!di->ac_chg || !di->ac_chg->ops.enable)
return -ENXIO;

--
2.27.0


2022-07-19 08:03:08

by Linus Walleij

[permalink] [raw]
Subject: Re: [PATCH] power: supply: ab8500: remove unused static local variable

On Tue, Jul 19, 2022 at 4:27 AM Tom Rix <[email protected]> wrote:

> cpp_check reports
> [drivers/power/supply/ab8500_chargalg.c:493]: (style) Variable 'ab8500_chargalg_ex_ac_enable_toggle' is assigned a value that is never used.
>
> From inspection, this variable is never used. So remove it.
>
> Fixes: 6c50a08d9dd3 ("power: supply: ab8500: Drop external charger leftovers")
> Signed-off-by: Tom Rix <[email protected]>

Thanks Tom!
Reviewed-by: Linus Walleij <[email protected]>

Yours,
Linus Walleij

2022-08-12 07:57:53

by Miles Chen

[permalink] [raw]
Subject: Re: [PATCH] power: supply: ab8500: remove unused static local variable

>> cpp_check reports
>> [drivers/power/supply/ab8500_chargalg.c:493]: (style) Variable 'ab8500_chargalg_ex_ac_enable_toggle' is assigned a value that is never used.
>>
>> From inspection, this variable is never used. So remove it.
>>
>> Fixes: 6c50a08d9dd3 ("power: supply: ab8500: Drop external charger leftovers")
>> Signed-off-by: Tom Rix <[email protected]>
>
>Thanks Tom!
>Reviewed-by: Linus Walleij <[email protected]>
>
>Yours,
>Linus Walleij

Hi Sebastian,

It looks like that this patch is not in linux-next 20220812
and I can still observe this build error with ARCH=arm, defconfig=allyesconfig.

Would you pick up this fix, please?

Thanks,
Miles

2022-08-17 02:21:44

by chenlifu

[permalink] [raw]
Subject: Re: [PATCH] power: supply: ab8500: remove unused static local variable

?? 2022/7/19 10:27, Tom Rix д??:
> cpp_check reports
> [drivers/power/supply/ab8500_chargalg.c:493]: (style) Variable 'ab8500_chargalg_ex_ac_enable_toggle' is assigned a value that is never used.
>
>>From inspection, this variable is never used. So remove it.
>
> Fixes: 6c50a08d9dd3 ("power: supply: ab8500: Drop external charger leftovers")
> Signed-off-by: Tom Rix <[email protected]>
> ---
> drivers/power/supply/ab8500_chargalg.c | 2 --
> 1 file changed, 2 deletions(-)
>
> diff --git a/drivers/power/supply/ab8500_chargalg.c b/drivers/power/supply/ab8500_chargalg.c
> index ae4be553f424..05146d436a6a 100644
> --- a/drivers/power/supply/ab8500_chargalg.c
> +++ b/drivers/power/supply/ab8500_chargalg.c
> @@ -490,8 +490,6 @@ static int ab8500_chargalg_kick_watchdog(struct ab8500_chargalg *di)
> static int ab8500_chargalg_ac_en(struct ab8500_chargalg *di, int enable,
> int vset_uv, int iset_ua)
> {
> - static int ab8500_chargalg_ex_ac_enable_toggle;
> -
> if (!di->ac_chg || !di->ac_chg->ops.enable)
> return -ENXIO;
>
>

Reviewed-by: Chen Lifu <[email protected]>


I can still observe this build error with ARCH=arm,
defconfig=allyesconfig in linux-next next-200816:

drivers/power/supply/ab8500_chargalg.c: In function ??ab8500_chargalg_ac_en??:
drivers/power/supply/ab8500_chargalg.c:493:13: error: unused variable
??ab8500_chargalg_ex_ac_enable_toggle?? [-Werror=unused-variable]
static int ab8500_chargalg_ex_ac_enable_toggle;
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

2022-08-17 02:52:01

by chenlifu

[permalink] [raw]
Subject: Re: [PATCH] power: supply: ab8500: remove unused static local variable

在 2022/8/17 9:57, chenlifu 写道:
> 在 2022/7/19 10:27, Tom Rix 写道:
>> cpp_check reports
>> [drivers/power/supply/ab8500_chargalg.c:493]: (style) Variable
>> 'ab8500_chargalg_ex_ac_enable_toggle' is assigned a value that is
>> never used.
>>
>>> From inspection, this variable is never used. So remove it.
>>
>> Fixes: 6c50a08d9dd3 ("power: supply: ab8500: Drop external charger
>> leftovers")
>> Signed-off-by: Tom Rix <[email protected]>
>> ---
>>   drivers/power/supply/ab8500_chargalg.c | 2 --
>>   1 file changed, 2 deletions(-)
>>
>> diff --git a/drivers/power/supply/ab8500_chargalg.c
>> b/drivers/power/supply/ab8500_chargalg.c
>> index ae4be553f424..05146d436a6a 100644
>> --- a/drivers/power/supply/ab8500_chargalg.c
>> +++ b/drivers/power/supply/ab8500_chargalg.c
>> @@ -490,8 +490,6 @@ static int ab8500_chargalg_kick_watchdog(struct
>> ab8500_chargalg *di)
>>   static int ab8500_chargalg_ac_en(struct ab8500_chargalg *di, int
>> enable,
>>       int vset_uv, int iset_ua)
>>   {
>> -    static int ab8500_chargalg_ex_ac_enable_toggle;
>> -
>>       if (!di->ac_chg || !di->ac_chg->ops.enable)
>>           return -ENXIO;
>>
>
> Reviewed-by: Chen Lifu <[email protected]>
>
>
> I can still observe this build error with ARCH=arm,
> defconfig=allyesconfig in linux-next next-200816:
>
> drivers/power/supply/ab8500_chargalg.c: In function
> ‘ab8500_chargalg_ac_en’:
> drivers/power/supply/ab8500_chargalg.c:493:13: error: unused variable
> ‘ab8500_chargalg_ex_ac_enable_toggle’ [-Werror=unused-variable]
>  static int ab8500_chargalg_ex_ac_enable_toggle;
>             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> .

Reviewed-by: Chen Lifu <[email protected]>

fixed the tag: next-200816 --> next-20220816

I can still observe this build error with ARCH=arm,
defconfig=allyesconfig in linux-next next-20220816:

drivers/power/supply/ab8500_chargalg.c: In function ‘ab8500_chargalg_ac_en’:
drivers/power/supply/ab8500_chargalg.c:493:13: error: unused variable
‘ab8500_chargalg_ex_ac_enable_toggle’ [-Werror=unused-variable]
static int ab8500_chargalg_ex_ac_enable_toggle;
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

2022-09-12 10:49:01

by Sebastian Reichel

[permalink] [raw]
Subject: Re: [PATCH] power: supply: ab8500: remove unused static local variable

Hi,

On Mon, Jul 18, 2022 at 10:27:43PM -0400, Tom Rix wrote:
> cpp_check reports
> [drivers/power/supply/ab8500_chargalg.c:493]: (style) Variable 'ab8500_chargalg_ex_ac_enable_toggle' is assigned a value that is never used.
>
> From inspection, this variable is never used. So remove it.
>
> Fixes: 6c50a08d9dd3 ("power: supply: ab8500: Drop external charger leftovers")
> Signed-off-by: Tom Rix <[email protected]>
> ---

Thanks, queued into power-supply's fixes branch.
Sorry for the delay.

-- Sebastian

> drivers/power/supply/ab8500_chargalg.c | 2 --
> 1 file changed, 2 deletions(-)
>
> diff --git a/drivers/power/supply/ab8500_chargalg.c b/drivers/power/supply/ab8500_chargalg.c
> index ae4be553f424..05146d436a6a 100644
> --- a/drivers/power/supply/ab8500_chargalg.c
> +++ b/drivers/power/supply/ab8500_chargalg.c
> @@ -490,8 +490,6 @@ static int ab8500_chargalg_kick_watchdog(struct ab8500_chargalg *di)
> static int ab8500_chargalg_ac_en(struct ab8500_chargalg *di, int enable,
> int vset_uv, int iset_ua)
> {
> - static int ab8500_chargalg_ex_ac_enable_toggle;
> -
> if (!di->ac_chg || !di->ac_chg->ops.enable)
> return -ENXIO;
>
> --
> 2.27.0
>


Attachments:
(No filename) (1.18 kB)
signature.asc (849.00 B)
Download all attachments