aboutsummaryrefslogtreecommitdiff
path: root/hw/ppc
diff options
context:
space:
mode:
authorPeter Maydell <peter.maydell@linaro.org>2018-10-30 17:03:53 +0000
committerDavid Gibson <david@gibson.dropbear.id.au>2018-11-08 12:04:40 +1100
commit09a333ee3dbbc6cdd88830f5b68dc358cacb0093 (patch)
treef347237b6dafedf89e9c6c1faff84f806c4ada21 /hw/ppc
parentbba8e23affb87622ce4a9ee3195729dbc4c3faac (diff)
downloadqemu-09a333ee3dbbc6cdd88830f5b68dc358cacb0093.zip
qemu-09a333ee3dbbc6cdd88830f5b68dc358cacb0093.tar.gz
qemu-09a333ee3dbbc6cdd88830f5b68dc358cacb0093.tar.bz2
hw/ppc/ppc440_uc: Remove dead code in sdram_size()
Coverity points out in CID 1390588 that the test for sh == 0 in sdram_size() can never fire, because we calculate sh with sh = 1024 - ((bcr >> 6) & 0x3ff); which must result in a value between 1 and 1024 inclusive. Without the relevant manual for the SoC, we're not completely sure of the correct behaviour here, but we can remove the dead code without changing how QEMU currently behaves. Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Reviewed-by: Laurent Vivier <lvivier@redhat.com> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Diffstat (limited to 'hw/ppc')
-rw-r--r--hw/ppc/ppc440_uc.c6
1 files changed, 1 insertions, 5 deletions
diff --git a/hw/ppc/ppc440_uc.c b/hw/ppc/ppc440_uc.c
index 09ccda5..9360f78 100644
--- a/hw/ppc/ppc440_uc.c
+++ b/hw/ppc/ppc440_uc.c
@@ -559,11 +559,7 @@ static target_ulong sdram_size(uint32_t bcr)
int sh;
sh = 1024 - ((bcr >> 6) & 0x3ff);
- if (sh == 0) {
- size = -1;
- } else {
- size = 8 * MiB * sh;
- }
+ size = 8 * MiB * sh;
return size;
}