[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 19/22] hw/ppc/ppc440_uc: Remove dead code in sdram_si
From: |
David Gibson |
Subject: |
[Qemu-devel] [PULL 19/22] hw/ppc/ppc440_uc: Remove dead code in sdram_size() |
Date: |
Thu, 8 Nov 2018 23:16:43 +1100 |
From: Peter Maydell <address@hidden>
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 <address@hidden>
Reviewed-by: Laurent Vivier <address@hidden>
Signed-off-by: David Gibson <address@hidden>
---
hw/ppc/ppc440_uc.c | 6 +-----
1 file changed, 1 insertion(+), 5 deletions(-)
diff --git a/hw/ppc/ppc440_uc.c b/hw/ppc/ppc440_uc.c
index 09ccda548f..9360f781ce 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;
}
--
2.19.1
- [Qemu-devel] [PULL 18/22] MAINTAINERS: PPC: Remove myself, (continued)
- [Qemu-devel] [PULL 18/22] MAINTAINERS: PPC: Remove myself, David Gibson, 2018/11/08
- [Qemu-devel] [PULL 04/22] PPC: e500: convert SysBus init method to a realize method, David Gibson, 2018/11/08
- [Qemu-devel] [PULL 11/22] target/ppc: Split out float_invalid_op_div, David Gibson, 2018/11/08
- [Qemu-devel] [PULL 22/22] ppc/spapr_caps: Add SPAPR_CAP_NESTED_KVM_HV, David Gibson, 2018/11/08
- [Qemu-devel] [PULL 09/22] target/ppc: Split out float_invalid_op_addsub, David Gibson, 2018/11/08
- [Qemu-devel] [PULL 10/22] target/ppc: Split out float_invalid_op_mul, David Gibson, 2018/11/08
- [Qemu-devel] [PULL 15/22] hw/ppc/mac_newworld: Free openpic_irqs array after use, David Gibson, 2018/11/08
- [Qemu-devel] [PULL 05/22] hw/ppc/spapr_rng: Introduce CONFIG_SPAPR_RNG switch for spapr_rng.c, David Gibson, 2018/11/08
- [Qemu-devel] [PULL 16/22] target/ppc: fix mtmsr instruction for icount, David Gibson, 2018/11/08
- [Qemu-devel] [PULL 14/22] macio/pmu: Fix missing vmsd terminator, David Gibson, 2018/11/08
- [Qemu-devel] [PULL 19/22] hw/ppc/ppc440_uc: Remove dead code in sdram_size(),
David Gibson <=
- [Qemu-devel] [PULL 21/22] target/ppc: Add one reg id for ptcr, David Gibson, 2018/11/08
- [Qemu-devel] [PULL 13/22] spapr_pci: convert g_malloc() to g_new(), David Gibson, 2018/11/08
- [Qemu-devel] [PULL 17/22] ppc/pnv: check size before data buffer access, David Gibson, 2018/11/08
- Re: [Qemu-devel] [PULL 00/22] ppc-for-3.1 queue 20181108, Eric Blake, 2018/11/08