From: Peter Maydell Date: Fri, 28 Mar 2014 15:12:55 +0000 (+0000) Subject: hw/ide/ahci.c: Avoid shift left into sign bit X-Git-Tag: v2.1.0-rc0~170^2~6 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=ee25595f0126de0f83da86cc29ba2365be7a50d2;p=thirdparty%2Fqemu.git 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 Signed-off-by: Michael Tokarev --- diff --git a/hw/ide/ahci.c b/hw/ide/ahci.c index bfe633f3a5e..50327ffdf12 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); } } }