linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] HID: picolcd: remove unused variable
@ 2021-04-07  6:39 Jiapeng Chong
  2021-04-07 16:28 ` Bruno Prémont
  0 siblings, 1 reply; 2+ messages in thread
From: Jiapeng Chong @ 2021-04-07  6:39 UTC (permalink / raw)
  To: bonbons
  Cc: jikos, benjamin.tissoires, linux-input, linux-kernel, Jiapeng Chong

Fix the following gcc warning:

drivers/hid/hid-picolcd_core.c:332:6: warning: variable ‘ret’ set but
not used [-Wunused-but-set-variable].

Reported-by: Abaci Robot <abaci@linux.alibaba.com>
Signed-off-by: Jiapeng Chong <jiapeng.chong@linux.alibaba.com>
---
 drivers/hid/hid-picolcd_core.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/hid/hid-picolcd_core.c b/drivers/hid/hid-picolcd_core.c
index 1b5c632..682c2a2 100644
--- a/drivers/hid/hid-picolcd_core.c
+++ b/drivers/hid/hid-picolcd_core.c
@@ -329,7 +329,6 @@ static int picolcd_raw_event(struct hid_device *hdev,
 {
 	struct picolcd_data *data = hid_get_drvdata(hdev);
 	unsigned long flags;
-	int ret = 0;
 
 	if (!data)
 		return 1;
@@ -342,9 +341,9 @@ static int picolcd_raw_event(struct hid_device *hdev,
 
 	if (report->id == REPORT_KEY_STATE) {
 		if (data->input_keys)
-			ret = picolcd_raw_keypad(data, report, raw_data+1, size-1);
+			picolcd_raw_keypad(data, report, raw_data+1, size-1);
 	} else if (report->id == REPORT_IR_DATA) {
-		ret = picolcd_raw_cir(data, report, raw_data+1, size-1);
+			picolcd_raw_cir(data, report, raw_data+1, size-1);
 	} else {
 		spin_lock_irqsave(&data->lock, flags);
 		/*
-- 
1.8.3.1


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

* Re: [PATCH] HID: picolcd: remove unused variable
  2021-04-07  6:39 [PATCH] HID: picolcd: remove unused variable Jiapeng Chong
@ 2021-04-07 16:28 ` Bruno Prémont
  0 siblings, 0 replies; 2+ messages in thread
From: Bruno Prémont @ 2021-04-07 16:28 UTC (permalink / raw)
  To: Jiapeng Chong; +Cc: jikos, benjamin.tissoires, linux-input, linux-kernel

Hi Jiapeng,

This is a dupe of a fix already sent two weeks ago by Lee Jones.

see series "Rid W=1 warnings from HID".


@Benjamin: At first glance the patch will not break anything.
           I've had no time though to check what 
             struct hid_device_id.raw_event
           expects as return value to verify if we can just drop ret
           or rather effectively should return something specific based
           on it.

Bruno

On Wed,  7 Apr 2021 14:39:22 +0800 Jiapeng Chong wrote:
> Fix the following gcc warning:
> 
> drivers/hid/hid-picolcd_core.c:332:6: warning: variable ‘ret’ set but
> not used [-Wunused-but-set-variable].
> 
> Reported-by: Abaci Robot <abaci@linux.alibaba.com>
> Signed-off-by: Jiapeng Chong <jiapeng.chong@linux.alibaba.com>
> ---
>  drivers/hid/hid-picolcd_core.c | 5 ++---
>  1 file changed, 2 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/hid/hid-picolcd_core.c b/drivers/hid/hid-picolcd_core.c
> index 1b5c632..682c2a2 100644
> --- a/drivers/hid/hid-picolcd_core.c
> +++ b/drivers/hid/hid-picolcd_core.c
> @@ -329,7 +329,6 @@ static int picolcd_raw_event(struct hid_device *hdev,
>  {
>  	struct picolcd_data *data = hid_get_drvdata(hdev);
>  	unsigned long flags;
> -	int ret = 0;
>  
>  	if (!data)
>  		return 1;
> @@ -342,9 +341,9 @@ static int picolcd_raw_event(struct hid_device *hdev,
>  
>  	if (report->id == REPORT_KEY_STATE) {
>  		if (data->input_keys)
> -			ret = picolcd_raw_keypad(data, report, raw_data+1, size-1);
> +			picolcd_raw_keypad(data, report, raw_data+1, size-1);
>  	} else if (report->id == REPORT_IR_DATA) {
> -		ret = picolcd_raw_cir(data, report, raw_data+1, size-1);
> +			picolcd_raw_cir(data, report, raw_data+1, size-1);
>  	} else {
>  		spin_lock_irqsave(&data->lock, flags);
>  		/*


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

end of thread, other threads:[~2021-04-07 16:35 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-04-07  6:39 [PATCH] HID: picolcd: remove unused variable Jiapeng Chong
2021-04-07 16:28 ` Bruno Prémont

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).