[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL v2 14/19] hw/input/adb-kbd: Remove dead assignment
From: |
Laurent Vivier |
Subject: |
[PULL v2 14/19] hw/input/adb-kbd: Remove dead assignment |
Date: |
Mon, 4 May 2020 17:59:51 +0200 |
From: Philippe Mathieu-Daudé <address@hidden>
Since commit 5a1f49718 the 'olen' variable is not really
used. Remove it to fix a warning reported by Clang static
code analyzer:
CC hw/input/adb-kbd.o
hw/input/adb-kbd.c:200:5: warning: Value stored to 'olen' is never read
olen = 0;
^ ~
Fixes: 5a1f49718 (adb: add support for QKeyCode)
Reported-by: Clang Static Analyzer
Suggested-by: BALATON Zoltan <address@hidden>
Acked-by: David Gibson <address@hidden>
Signed-off-by: Philippe Mathieu-Daudé <address@hidden>
Message-Id: <address@hidden>
Signed-off-by: Laurent Vivier <address@hidden>
---
hw/input/adb-kbd.c | 6 +-----
1 file changed, 1 insertion(+), 5 deletions(-)
diff --git a/hw/input/adb-kbd.c b/hw/input/adb-kbd.c
index 0ba82075897f..a6d5c9b7c9ac 100644
--- a/hw/input/adb-kbd.c
+++ b/hw/input/adb-kbd.c
@@ -195,9 +195,7 @@ static int adb_kbd_poll(ADBDevice *d, uint8_t *obuf)
{
KBDState *s = ADB_KEYBOARD(d);
int keycode;
- int olen;
- olen = 0;
if (s->count == 0) {
return 0;
}
@@ -216,7 +214,6 @@ static int adb_kbd_poll(ADBDevice *d, uint8_t *obuf)
if (keycode == 0x7f) {
obuf[0] = 0x7f;
obuf[1] = 0x7f;
- olen = 2;
} else {
obuf[0] = keycode;
/* NOTE: the power key key-up is the two byte sequence 0xff 0xff;
@@ -224,10 +221,9 @@ static int adb_kbd_poll(ADBDevice *d, uint8_t *obuf)
* byte, but choose not to bother.
*/
obuf[1] = 0xff;
- olen = 2;
}
- return olen;
+ return 2;
}
static int adb_kbd_request(ADBDevice *d, uint8_t *obuf,
--
2.26.2
- [PULL v2 03/19] timer/exynos4210_mct: Remove redundant statement in exynos4210_mct_write(), (continued)
- [PULL v2 03/19] timer/exynos4210_mct: Remove redundant statement in exynos4210_mct_write(), Laurent Vivier, 2020/05/04
- [PULL v2 12/19] blockdev: Remove dead assignment, Laurent Vivier, 2020/05/04
- [PULL v2 01/19] scsi/esp-pci: add g_assert() for fix clang analyzer warning in esp_pci_io_write(), Laurent Vivier, 2020/05/04
- [PULL v2 10/19] Compress lines for immediate return, Laurent Vivier, 2020/05/04
- [PULL v2 09/19] chardev: Add macOS to list of OSes that support -chardev serial, Laurent Vivier, 2020/05/04
- [PULL v2 13/19] hw/i2c/pm_smbus: Remove dead assignment, Laurent Vivier, 2020/05/04
- [PULL v2 17/19] hw/gpio/aspeed_gpio: Remove dead assignment, Laurent Vivier, 2020/05/04
- [PULL v2 19/19] hw/timer/pxa2xx_timer: Add assertion to silent static analyzer warning, Laurent Vivier, 2020/05/04
- [PULL v2 15/19] hw/ide/sii3112: Remove dead assignment, Laurent Vivier, 2020/05/04
- [PULL v2 11/19] block: Avoid dead assignment, Laurent Vivier, 2020/05/04
- [PULL v2 14/19] hw/input/adb-kbd: Remove dead assignment,
Laurent Vivier <=
- [PULL v2 16/19] hw/isa/i82378: Remove dead assignment, Laurent Vivier, 2020/05/04
- [PULL v2 18/19] hw/timer/stm32f2xx_timer: Remove dead assignment, Laurent Vivier, 2020/05/04
- Re: [PULL v2 00/19] Trivial branch for 5.1 patches, Peter Maydell, 2020/05/05