[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-ppc] [PATCH v2 06/12] hw/usb/hcd-ohci.c: Avoid shifting left into
From: |
Peter Maydell |
Subject: |
[Qemu-ppc] [PATCH v2 06/12] hw/usb/hcd-ohci.c: Avoid shifting left into sign bit |
Date: |
Mon, 17 Mar 2014 16:00:35 +0000 |
Add U suffix to avoid undefined behaviour. This is only
strictly necessary for the 1<<31 cases, but we add it for the
other constants in these groups for consistency.
Signed-off-by: Peter Maydell <address@hidden>
---
hw/usb/hcd-ohci.c | 32 ++++++++++++++++----------------
1 file changed, 16 insertions(+), 16 deletions(-)
diff --git a/hw/usb/hcd-ohci.c b/hw/usb/hcd-ohci.c
index 3d35058b..93f186f 100644
--- a/hw/usb/hcd-ohci.c
+++ b/hw/usb/hcd-ohci.c
@@ -234,15 +234,15 @@ struct ohci_iso_td {
#define OHCI_STATUS_OCR (1<<3)
#define OHCI_STATUS_SOC ((1<<6)|(1<<7))
-#define OHCI_INTR_SO (1<<0) /* Scheduling overrun */
-#define OHCI_INTR_WD (1<<1) /* HcDoneHead writeback */
-#define OHCI_INTR_SF (1<<2) /* Start of frame */
-#define OHCI_INTR_RD (1<<3) /* Resume detect */
-#define OHCI_INTR_UE (1<<4) /* Unrecoverable error */
-#define OHCI_INTR_FNO (1<<5) /* Frame number overflow */
-#define OHCI_INTR_RHSC (1<<6) /* Root hub status change */
-#define OHCI_INTR_OC (1<<30) /* Ownership change */
-#define OHCI_INTR_MIE (1<<31) /* Master Interrupt Enable */
+#define OHCI_INTR_SO (1U<<0) /* Scheduling overrun */
+#define OHCI_INTR_WD (1U<<1) /* HcDoneHead writeback */
+#define OHCI_INTR_SF (1U<<2) /* Start of frame */
+#define OHCI_INTR_RD (1U<<3) /* Resume detect */
+#define OHCI_INTR_UE (1U<<4) /* Unrecoverable error */
+#define OHCI_INTR_FNO (1U<<5) /* Frame number overflow */
+#define OHCI_INTR_RHSC (1U<<6) /* Root hub status change */
+#define OHCI_INTR_OC (1U<<30) /* Ownership change */
+#define OHCI_INTR_MIE (1U<<31) /* Master Interrupt Enable */
#define OHCI_HCCA_SIZE 0x100
#define OHCI_HCCA_MASK 0xffffff00
@@ -253,7 +253,7 @@ struct ohci_iso_td {
#define OHCI_FMI_FSMPS 0xffff0000
#define OHCI_FMI_FIT 0x80000000
-#define OHCI_FR_RT (1<<31)
+#define OHCI_FR_RT (1U<<31)
#define OHCI_LS_THRESH 0x628
@@ -265,12 +265,12 @@ struct ohci_iso_td {
#define OHCI_RHA_NOCP (1<<12)
#define OHCI_RHA_POTPGT_MASK 0xff000000
-#define OHCI_RHS_LPS (1<<0)
-#define OHCI_RHS_OCI (1<<1)
-#define OHCI_RHS_DRWE (1<<15)
-#define OHCI_RHS_LPSC (1<<16)
-#define OHCI_RHS_OCIC (1<<17)
-#define OHCI_RHS_CRWE (1<<31)
+#define OHCI_RHS_LPS (1U<<0)
+#define OHCI_RHS_OCI (1U<<1)
+#define OHCI_RHS_DRWE (1U<<15)
+#define OHCI_RHS_LPSC (1U<<16)
+#define OHCI_RHS_OCIC (1U<<17)
+#define OHCI_RHS_CRWE (1U<<31)
#define OHCI_PORT_CCS (1<<0)
#define OHCI_PORT_PES (1<<1)
--
1.9.0
- [Qemu-ppc] [PATCH v2 00/12] Avoid shifting left into sign bit, Peter Maydell, 2014/03/17
- [Qemu-ppc] [PATCH v2 12/12] hw/pci-host/apb.c: Avoid shifting left into sign bit, Peter Maydell, 2014/03/17
- [Qemu-ppc] [PATCH v2 11/12] hw/intc/xilinx_intc: Avoid shifting left into sign bit, Peter Maydell, 2014/03/17
- [Qemu-ppc] [PATCH v2 07/12] hw/intc/openpic: Avoid shifting left into sign bit, Peter Maydell, 2014/03/17
- [Qemu-ppc] [PATCH v2 02/12] hw/intc/apic.c: Use uint32_t for mask word in foreach_apic, Peter Maydell, 2014/03/17
- [Qemu-ppc] [PATCH v2 03/12] hw/pci/pci_host.c: Avoid shifting left into sign bit, Peter Maydell, 2014/03/17
- [Qemu-ppc] [PATCH v2 10/12] hw/intc/slavio_intctl: Avoid shifting left into sign bit, Peter Maydell, 2014/03/17
- [Qemu-ppc] [PATCH v2 04/12] hw/i386/acpi_build.c: Avoid shifting left into sign bit, Peter Maydell, 2014/03/17
- [Qemu-ppc] [PATCH v2 09/12] tests/libqos/pci-pc: Avoid shifting left into sign bit, Peter Maydell, 2014/03/17
- [Qemu-ppc] [PATCH v2 01/12] target-i386: Avoid shifting left into sign bit, Peter Maydell, 2014/03/17
- [Qemu-ppc] [PATCH v2 06/12] hw/usb/hcd-ohci.c: Avoid shifting left into sign bit,
Peter Maydell <=
- [Qemu-ppc] [PATCH v2 08/12] hw/ppc: Avoid shifting left into sign bit, Peter Maydell, 2014/03/17
- [Qemu-ppc] [PATCH v2 05/12] target-mips: Avoid shifting left into sign bit, Peter Maydell, 2014/03/17
- Re: [Qemu-ppc] [Qemu-trivial] [PATCH v2 00/12] Avoid shifting left into sign bit, Michael Tokarev, 2014/03/20