From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:54590) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WTYSq-0002XQ-P3 for qemu-devel@nongnu.org; Fri, 28 Mar 2014 11:13:01 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WTYSp-0004Ky-T6 for qemu-devel@nongnu.org; Fri, 28 Mar 2014 11:13:00 -0400 From: Peter Maydell Date: Fri, 28 Mar 2014 15:12:55 +0000 Message-Id: <1396019577-2013-2-git-send-email-peter.maydell@linaro.org> In-Reply-To: <1396019577-2013-1-git-send-email-peter.maydell@linaro.org> References: <1396019577-2013-1-git-send-email-peter.maydell@linaro.org> Subject: [Qemu-devel] [PATCH 1/3] hw/ide/ahci.c: Avoid shift left into sign bit List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: qemu-trivial@nongnu.org, patches@linaro.org Add U suffix to avoid shifting left into the sign bit, which is undefined behaviour. Signed-off-by: Peter Maydell --- hw/ide/ahci.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hw/ide/ahci.c b/hw/ide/ahci.c index bfe633f..50327ff 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); } } } -- 1.9.0