power: supply: ab8500: Drop pointless static qualifier in ab8500_btemp_batctrl_volt_to_res()
Subsystems (3)
PATCH 1/1 power: supply: ab8500: Drop pointless static qualifier in ab8500_btemp_batctrl_volt_to_res()
There is no need to have the 'T *v' variable static since new value always be assigned before use it.
--- drivers/power/supply/ab8500_btemp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/power/supply/ab8500_btemp.c +1 -1
@@ -180,7 +180,7 @@ static int ab8500_btemp_batctrl_volt_to_res(struct ab8500_btemp *di,static int ab8500_btemp_read_batctrl_voltage (struct ab8500_btemp *di) {int vbtemp, ret; -static int prev; +int prev; ret =iio_read_channel_processed (di->bat_ctrl, &vbtemp);if (ret <0 ) {
Signature · 1 line
2.20.1
Quoted 14 lines · Mao Wenan
There is no need to have the 'T *v' variable static since new value always be assigned before use it.
Reported-by Hulk Robot <[email protected]>Signed-off-by Mao Wenan <[email protected]>--- drivers/power/supply/ab8500_btemp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/power/supply/ab8500_btemp.c +0
-0
drivers/power/supply/ab8500_btemp.c static int ab8500_btemp_batctrl_volt_to_res(struct ab8500_btemp *di, · line 183
Quoted 5 lines
drivers/power/supply/ab8500_btemp.c +1
-1@@ -180,7 +180,7 @@ static int ab8500_btemp_batctrl_volt_to_res(struct ab8500_btemp *di,static int ab8500_btemp_read_batctrl_voltage (struct ab8500_btemp *di) {int vbtemp, ret; -static int prev; +int prev;
No. We use it first on linux-next (yesterday). It needs to be static.
regards,
dan carpenter
Quoted 10 lines · Dan Carpenter
Quoted 9 lines · Mao Wenan
There is no need to have the 'T *v' variable static since new value always be assigned before use it.
Reported-by Hulk Robot <[email protected]>Signed-off-by Mao Wenan <[email protected]>--- drivers/power/supply/ab8500_btemp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Quoted 13 lines
drivers/power/supply/ab8500_btemp.c static int ab8500_btemp_batctrl_volt_to_res(struct ab8500_btemp *di, · line 183
Quoted 10 lines
drivers/power/supply/ab8500_btemp.c +1
-1@@ -180,7 +180,7 @@ static int ab8500_btemp_batctrl_volt_to_res(struct ab8500_btemp *di,static int ab8500_btemp_read_batctrl_voltage (struct ab8500_btemp *di) {int vbtemp, ret; -static int prev; +int prev;No. We use it first on linux-next (yesterday). It needs to be static.
It's surprising that your patch didn't cause an uninitialized variable compile warning for you.
regards,
dan carpenter