]> git.proxmox.com Git - qemu.git/blobdiff - hw/sd/pl181.c
sd/pl181.c: Avoid undefined shift behaviour in RWORD macro
[qemu.git] / hw / sd / pl181.c
index 4b1723418d3238f34cf6b9bd35f0a1107d97f934..f5eb1e40120c6a9572b48ba3d135b7c9d9734ab3 100644 (file)
@@ -175,7 +175,7 @@ static void pl181_send_command(pl181_state *s)
     if (rlen < 0)
         goto error;
     if (s->cmd & PL181_CMD_RESPONSE) {
-#define RWORD(n) ((response[n] << 24) | (response[n + 1] << 16) \
+#define RWORD(n) (((uint32_t)response[n] << 24) | (response[n + 1] << 16) \
                   | (response[n + 2] << 8) | response[n + 3])
         if (rlen == 0 || (rlen == 4 && (s->cmd & PL181_CMD_LONGRESP)))
             goto error;