* [PATCH] Input: aiptek - remove redundant assignment to variable ret
@ 2022-04-18 14:24 Colin Ian King
2022-04-25 4:01 ` Dmitry Torokhov
0 siblings, 1 reply; 2+ messages in thread
From: Colin Ian King @ 2022-04-18 14:24 UTC (permalink / raw)
To: Dmitry Torokhov, linux-input; +Cc: kernel-janitors, linux-kernel, llvm
Variable ret is being assigned a value that is never read, it is
being re-assigned again in either path of the if statement. The
assignment is redundant and can be removed.
Cleans up clang scan build warning:
Although the value stored to 'ret' is used in the enclosing expression,
the value is never actually read from 'ret' [deadcode.DeadStores]
Signed-off-by: Colin Ian King <colin.i.king@gmail.com>
---
drivers/input/tablet/aiptek.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/input/tablet/aiptek.c b/drivers/input/tablet/aiptek.c
index 1581f6ef0927..24ec4844a5c3 100644
--- a/drivers/input/tablet/aiptek.c
+++ b/drivers/input/tablet/aiptek.c
@@ -931,8 +931,7 @@ aiptek_query(struct aiptek *aiptek, unsigned char command, unsigned char data)
}
msleep(aiptek->curSetting.programmableDelay);
- if ((ret =
- aiptek_get_report(aiptek, 3, 2, buf, sizeof_buf)) != sizeof_buf) {
+ if (aiptek_get_report(aiptek, 3, 2, buf, sizeof_buf) != sizeof_buf) {
dev_dbg(&aiptek->intf->dev,
"aiptek_query failed: returned 0x%02x 0x%02x 0x%02x\n",
buf[0], buf[1], buf[2]);
--
2.35.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] Input: aiptek - remove redundant assignment to variable ret
2022-04-18 14:24 [PATCH] Input: aiptek - remove redundant assignment to variable ret Colin Ian King
@ 2022-04-25 4:01 ` Dmitry Torokhov
0 siblings, 0 replies; 2+ messages in thread
From: Dmitry Torokhov @ 2022-04-25 4:01 UTC (permalink / raw)
To: Colin Ian King; +Cc: linux-input, kernel-janitors, linux-kernel, llvm
On Mon, Apr 18, 2022 at 03:24:57PM +0100, Colin Ian King wrote:
> Variable ret is being assigned a value that is never read, it is
> being re-assigned again in either path of the if statement. The
> assignment is redundant and can be removed.
>
> Cleans up clang scan build warning:
> Although the value stored to 'ret' is used in the enclosing expression,
> the value is never actually read from 'ret' [deadcode.DeadStores]
>
> Signed-off-by: Colin Ian King <colin.i.king@gmail.com>
Applied, thank you.
--
Dmitry
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2022-04-25 4:02 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-04-18 14:24 [PATCH] Input: aiptek - remove redundant assignment to variable ret Colin Ian King
2022-04-25 4:01 ` Dmitry Torokhov
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.