qemu-trivial
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-trivial] [PULL 05/11] hw/ide/ahci.c: Avoid shift left into sign bi


From: Michael Tokarev
Subject: [Qemu-trivial] [PULL 05/11] hw/ide/ahci.c: Avoid shift left into sign bit
Date: Tue, 8 Apr 2014 11:04:05 +0400

From: Peter Maydell <address@hidden>

Add U suffix to avoid shifting left into the sign bit, which
is undefined behaviour.

Signed-off-by: Peter Maydell <address@hidden>
Signed-off-by: Michael Tokarev <address@hidden>
---
 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.7.10.4




reply via email to

[Prev in Thread] Current Thread [Next in Thread]