OSDN Git Service

hw/block/pflash_cfi02: Remove unneeded variable assignment
authorPhilippe Mathieu-Daudé <philmd@redhat.com>
Sat, 15 Feb 2020 16:15:57 +0000 (17:15 +0100)
committerLaurent Vivier <laurent@vivier.eu>
Tue, 18 Feb 2020 19:20:49 +0000 (20:20 +0100)
Fix warning reported by Clang static code analyzer:

    CC      hw/block/pflash_cfi02.o
  hw/block/pflash_cfi02.c:311:5: warning: Value stored to 'ret' is never read
      ret = -1;
      ^     ~~

Reported-by: Clang Static Analyzer
Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20200215161557.4077-4-philmd@redhat.com>
Signed-off-by: Laurent Vivier <laurent@vivier.eu>
hw/block/pflash_cfi02.c

index 7c4744c..12f18d4 100644 (file)
@@ -308,7 +308,6 @@ static uint64_t pflash_read(void *opaque, hwaddr offset, unsigned int width)
     hwaddr boff;
     uint64_t ret;
 
-    ret = -1;
     /* Lazy reset to ROMD mode after a certain amount of read accesses */
     if (!pfl->rom_mode && pfl->wcycle == 0 &&
         ++pfl->read_counter > PFLASH_LAZY_ROMD_THRESHOLD) {