linux-leds.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/1] leds: blinkm: remove unused variable 'ret' in blinkm_init_hw()
@ 2021-05-19 12:41 Zhen Lei
  2021-06-23 20:20 ` Pavel Machek
  0 siblings, 1 reply; 2+ messages in thread
From: Zhen Lei @ 2021-05-19 12:41 UTC (permalink / raw)
  To: Jan-Simon Moeller, Pavel Machek, linux-leds; +Cc: Zhen Lei

GCC reports the following warning with W=1:

drivers/leds/leds-blinkm.c:483:6: warning:
 variable 'ret' set but not used [-Wunused-but-set-variable]
  483 |  int ret;
      |      ^~~

This variable is not used, remove it to fix the warning.

Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Zhen Lei <thunder.leizhen@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 b4e1fdff4186..e34879b4c275 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);
+	(void)blinkm_transfer_hw(client, BLM_STOP_SCRIPT);
+	(void)blinkm_transfer_hw(client, BLM_GO_RGB);
 }
 
 static int blinkm_test_run(struct i2c_client *client)
-- 
2.25.1



^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH 1/1] leds: blinkm: remove unused variable 'ret' in blinkm_init_hw()
  2021-05-19 12:41 [PATCH 1/1] leds: blinkm: remove unused variable 'ret' in blinkm_init_hw() Zhen Lei
@ 2021-06-23 20:20 ` Pavel Machek
  0 siblings, 0 replies; 2+ messages in thread
From: Pavel Machek @ 2021-06-23 20:20 UTC (permalink / raw)
  To: Zhen Lei; +Cc: Jan-Simon Moeller, linux-leds

[-- Attachment #1: Type: text/plain, Size: 664 bytes --]

On Wed 2021-05-19 20:41:36, Zhen Lei wrote:
> GCC reports the following warning with W=1:
> 
> drivers/leds/leds-blinkm.c:483:6: warning:
>  variable 'ret' set but not used [-Wunused-but-set-variable]
>   483 |  int ret;
>       |      ^~~
> 
> This variable is not used, remove it to fix the warning.
> 
> Reported-by: Hulk Robot <hulkci@huawei.com>
> Signed-off-by: Zhen Lei <thunder.leizhen@huawei.com>

Sounds like valid warning, and likely function should just propagate
the error value.

It would be good if someone with the hardware could take a look.

Best regards,
								Pavel
								
-- 
http://www.livejournal.com/~pavelmachek

[-- 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:[~2021-06-23 20:20 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-05-19 12:41 [PATCH 1/1] leds: blinkm: remove unused variable 'ret' in blinkm_init_hw() Zhen Lei
2021-06-23 20:20 ` 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).