* [PATCH -next] leds: blinkm: remove set but not used variable
@ 2020-05-09 14:23 Hongbo Yao
2020-05-25 10:49 ` Pavel Machek
0 siblings, 1 reply; 2+ messages in thread
From: Hongbo Yao @ 2020-05-09 14:23 UTC (permalink / raw)
To: jansimon.moeller, jacek.anaszewski, pavel
Cc: yaohongbo, chenzhou10, linux-kernel, linux-leds
Fixes gcc '-Wunused-but-set-variable' warning:
drivers/leds/leds-blinkm.c:483:6: warning: variable ‘ret’ set
but not used [-Wunused-but-set-variable]
int ret;
Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Hongbo Yao <yaohongbo@huawei.com>
---
drivers/leds/leds-blinkm.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/drivers/leds/leds-blinkm.c b/drivers/leds/leds-blinkm.c
index e11fe1788242..a493ee0e0fc7 100644
--- a/drivers/leds/leds-blinkm.c
+++ b/drivers/leds/leds-blinkm.c
@@ -480,9 +480,8 @@ static int blinkm_led_blue_set(struct led_classdev *led_cdev,
static void blinkm_init_hw(struct i2c_client *client)
{
- int ret;
- ret = blinkm_transfer_hw(client, BLM_STOP_SCRIPT);
- ret = blinkm_transfer_hw(client, BLM_GO_RGB);
+ blinkm_transfer_hw(client, BLM_STOP_SCRIPT);
+ blinkm_transfer_hw(client, BLM_GO_RGB);
}
static int blinkm_test_run(struct i2c_client *client)
--
2.17.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH -next] leds: blinkm: remove set but not used variable
2020-05-09 14:23 [PATCH -next] leds: blinkm: remove set but not used variable Hongbo Yao
@ 2020-05-25 10:49 ` Pavel Machek
0 siblings, 0 replies; 2+ messages in thread
From: Pavel Machek @ 2020-05-25 10:49 UTC (permalink / raw)
To: Hongbo Yao
Cc: jansimon.moeller, jacek.anaszewski, chenzhou10, linux-kernel, linux-leds
[-- Attachment #1: Type: text/plain, Size: 1252 bytes --]
On Sat 2020-05-09 22:23:57, Hongbo Yao wrote:
> Fixes gcc '-Wunused-but-set-variable' warning:
> drivers/leds/leds-blinkm.c:483:6: warning: variable ‘ret’ set
> but not used [-Wunused-but-set-variable]
> int ret;
Should error be propagated?
Pavel
> Reported-by: Hulk Robot <hulkci@huawei.com>
> Signed-off-by: Hongbo Yao <yaohongbo@huawei.com>
> ---
> drivers/leds/leds-blinkm.c | 5 ++---
> 1 file changed, 2 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/leds/leds-blinkm.c b/drivers/leds/leds-blinkm.c
> index e11fe1788242..a493ee0e0fc7 100644
> --- a/drivers/leds/leds-blinkm.c
> +++ b/drivers/leds/leds-blinkm.c
> @@ -480,9 +480,8 @@ static int blinkm_led_blue_set(struct led_classdev *led_cdev,
>
> static void blinkm_init_hw(struct i2c_client *client)
> {
> - int ret;
> - ret = blinkm_transfer_hw(client, BLM_STOP_SCRIPT);
> - ret = blinkm_transfer_hw(client, BLM_GO_RGB);
> + blinkm_transfer_hw(client, BLM_STOP_SCRIPT);
> + blinkm_transfer_hw(client, BLM_GO_RGB);
> }
>
> static int blinkm_test_run(struct i2c_client *client)
--
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 181 bytes --]
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2020-05-25 10:49 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-09 14:23 [PATCH -next] leds: blinkm: remove set but not used variable Hongbo Yao
2020-05-25 10:49 ` Pavel Machek
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).