[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v3 5/9] hw/ide/sii3112: Remove dead assignment
From: |
Philippe Mathieu-Daudé |
Subject: |
[PATCH v3 5/9] hw/ide/sii3112: Remove dead assignment |
Date: |
Wed, 22 Apr 2020 15:31:48 +0200 |
Fix warning reported by Clang static code analyzer:
CC hw/ide/sii3112.o
hw/ide/sii3112.c:204:9: warning: Value stored to 'val' is never read
val = 0;
^ ~
Fixes: a9dd6604
Reported-by: Clang Static Analyzer
Reviewed-by: BALATON Zoltan <address@hidden>
Acked-by: John Snow <address@hidden>
Signed-off-by: Philippe Mathieu-Daudé <address@hidden>
---
hw/ide/sii3112.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/hw/ide/sii3112.c b/hw/ide/sii3112.c
index d69079c3d9..94d2b57f95 100644
--- a/hw/ide/sii3112.c
+++ b/hw/ide/sii3112.c
@@ -42,7 +42,7 @@ static uint64_t sii3112_reg_read(void *opaque, hwaddr addr,
unsigned int size)
{
SiI3112PCIState *d = opaque;
- uint64_t val = 0;
+ uint64_t val;
switch (addr) {
case 0x00:
@@ -126,6 +126,7 @@ static uint64_t sii3112_reg_read(void *opaque, hwaddr addr,
break;
default:
val = 0;
+ break;
}
trace_sii3112_read(size, addr, val);
return val;
@@ -201,7 +202,7 @@ static void sii3112_reg_write(void *opaque, hwaddr addr,
d->regs[1].sien = (val >> 16) & 0x3eed;
break;
default:
- val = 0;
+ break;
}
}
--
2.21.1
- [PATCH v3 0/9] misc: Trivial static code analyzer fixes, Philippe Mathieu-Daudé, 2020/04/22
- [PATCH v3 1/9] block: Avoid dead assignment, Philippe Mathieu-Daudé, 2020/04/22
- [PATCH v3 3/9] hw/i2c/pm_smbus: Remove dead assignment, Philippe Mathieu-Daudé, 2020/04/22
- [PATCH v3 4/9] hw/input/adb-kbd: Remove dead assignment, Philippe Mathieu-Daudé, 2020/04/22
- [PATCH v3 5/9] hw/ide/sii3112: Remove dead assignment,
Philippe Mathieu-Daudé <=
- [PATCH v3 6/9] hw/isa/i82378: Remove dead assignment, Philippe Mathieu-Daudé, 2020/04/22
- [PATCH v3 7/9] hw/gpio/aspeed_gpio: Remove dead assignment, Philippe Mathieu-Daudé, 2020/04/22
- [PATCH v3 8/9] hw/timer/stm32f2xx_timer: Remove dead assignment, Philippe Mathieu-Daudé, 2020/04/22
- [PATCH v3 9/9] hw/timer/pxa2xx_timer: Add assertion to silent static analyzer warning, Philippe Mathieu-Daudé, 2020/04/22
- [PATCH v3 2/9] blockdev: Remove dead assignment, Philippe Mathieu-Daudé, 2020/04/22