qemu-trivial
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH-for-5.0 05/11] hw/ide/sii3112: Remove dead assignment


From: BALATON Zoltan
Subject: Re: [PATCH-for-5.0 05/11] hw/ide/sii3112: Remove dead assignment
Date: Sat, 21 Mar 2020 14:04:59 +0100 (CET)
User-agent: Alpine 2.22 (BSF 395 2020-01-19)

On Sat, 21 Mar 2020, Philippe Mathieu-Daudé wrote:
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;
         ^     ~

Reported-by: Clang Static Analyzer
Signed-off-by: Philippe Mathieu-Daudé <address@hidden>
---
hw/ide/sii3112.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/hw/ide/sii3112.c b/hw/ide/sii3112.c
index 06605d7af2..36f1905ddb 100644
--- a/hw/ide/sii3112.c
+++ b/hw/ide/sii3112.c
@@ -125,7 +125,7 @@ static uint64_t sii3112_reg_read(void *opaque, hwaddr addr,
        val = (uint32_t)d->regs[1].sien << 16;
        break;
    default:
-        val = 0;
+        break;
    }
    trace_sii3112_read(size, addr, val);
    return val;

Value is clearly used in trace and return so don't really get why the compiler complains here. Looks like wrong warning to me. It's true however that since val is init to 0 at the beginning this assignment is not strictily needed and this should work as well, so

Reviewed-by: BALATON Zoltan <address@hidden>

Regards,
BALATON Zoltan

reply via email to

[Prev in Thread] Current Thread [Next in Thread]