diff options
author | Michael Walle | 2016-10-14 11:51:50 +0200 |
---|---|---|
committer | Michael Tokarev | 2016-10-28 17:17:23 +0200 |
commit | c1a900cf4a3925c2e4b313b82da5df955f17b70a (patch) | |
tree | fe8b210b92d6372a5e99236acdca7ba2985710a6 /hw/misc/milkymist-pfpu.c | |
parent | hw/block/nvme: Simplify if-statements a little bit (diff) | |
download | qemu-c1a900cf4a3925c2e4b313b82da5df955f17b70a.tar.gz qemu-c1a900cf4a3925c2e4b313b82da5df955f17b70a.tar.xz qemu-c1a900cf4a3925c2e4b313b82da5df955f17b70a.zip |
milkymist-pfpu: fix potential integer overflow
Since the lm32 is a 32 bit architecture, just return a 32 bit value which
is then converted to a 64 bit value.
Spotted by coverity, CID 1005506.
Signed-off-by: Michael Walle <michael@walle.cc>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
Diffstat (limited to 'hw/misc/milkymist-pfpu.c')
-rw-r--r-- | hw/misc/milkymist-pfpu.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/hw/misc/milkymist-pfpu.c b/hw/misc/milkymist-pfpu.c index 1da21a643e..3ca25894f1 100644 --- a/hw/misc/milkymist-pfpu.c +++ b/hw/misc/milkymist-pfpu.c @@ -137,7 +137,7 @@ struct MilkymistPFPUState { }; typedef struct MilkymistPFPUState MilkymistPFPUState; -static inline hwaddr +static inline uint32_t get_dma_address(uint32_t base, uint32_t x, uint32_t y) { return base + 8 * (128 * y + x); |