summaryrefslogtreecommitdiffstats
path: root/hw
diff options
context:
space:
mode:
authorPeter Maydell2014-03-28 16:12:55 +0100
committerMichael Tokarev2014-04-18 08:33:36 +0200
commitee25595f0126de0f83da86cc29ba2365be7a50d2 (patch)
tree3ca0ced8c087c66eed997c8c3def0443e1a1b158 /hw
parentnet: Report error when device / hub combo is not found. (diff)
downloadqemu-ee25595f0126de0f83da86cc29ba2365be7a50d2.tar.gz
qemu-ee25595f0126de0f83da86cc29ba2365be7a50d2.tar.xz
qemu-ee25595f0126de0f83da86cc29ba2365be7a50d2.zip
hw/ide/ahci.c: Avoid shift left into sign bit
Add U suffix to avoid shifting left into the sign bit, which is undefined behaviour. Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
Diffstat (limited to 'hw')
-rw-r--r--hw/ide/ahci.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/hw/ide/ahci.c b/hw/ide/ahci.c
index bfe633f3a5..50327ffdf1 100644
--- a/hw/ide/ahci.c
+++ b/hw/ide/ahci.c
@@ -438,9 +438,9 @@ static void check_cmd(AHCIState *s, int port)
if ((pr->cmd & PORT_CMD_START) && pr->cmd_issue) {
for (slot = 0; (slot < 32) && pr->cmd_issue; slot++) {
- if ((pr->cmd_issue & (1 << slot)) &&
+ if ((pr->cmd_issue & (1U << slot)) &&
!handle_cmd(s, port, slot)) {
- pr->cmd_issue &= ~(1 << slot);
+ pr->cmd_issue &= ~(1U << slot);
}
}
}