]> Git Repo - qemu.git/commitdiff
hw/pci/pci_host.c: Avoid shifting left into sign bit
authorPeter Maydell <[email protected]>
Mon, 17 Mar 2014 16:00:32 +0000 (16:00 +0000)
committerMichael Tokarev <[email protected]>
Thu, 27 Mar 2014 15:22:49 +0000 (19:22 +0400)
Add U suffix to avoid undefined behaviour.

Signed-off-by: Peter Maydell <[email protected]>
Reviewed-by: Michael S. Tsirkin <[email protected]>
Signed-off-by: Michael Tokarev <[email protected]>
hw/pci/pci_host.c

index 77c7d1f86b0c9f96f338ea5494480829c1b9a208..3e26f9256c77d22f2c61e228ae0bd44e83514b4c 100644 (file)
@@ -142,8 +142,9 @@ static uint64_t pci_host_data_read(void *opaque,
 {
     PCIHostState *s = opaque;
     uint32_t val;
-    if (!(s->config_reg & (1 << 31)))
+    if (!(s->config_reg & (1U << 31))) {
         return 0xffffffff;
+    }
     val = pci_data_read(s->bus, s->config_reg | (addr & 3), len);
     PCI_DPRINTF("read addr " TARGET_FMT_plx " len %d val %x\n",
                 addr, len, val);
This page took 0.027321 seconds and 4 git commands to generate.