提交 09a333ee 编写于 作者: P Peter Maydell 提交者: David Gibson

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: NPeter Maydell <peter.maydell@linaro.org>
Reviewed-by: NLaurent Vivier <lvivier@redhat.com>
Signed-off-by: NDavid Gibson <david@gibson.dropbear.id.au>
上级 bba8e23a
......@@ -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;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册