OSDN Git Service

Fix harmless if statements with empty body, spotted by clang
authorBlue Swirl <blauwirbel@gmail.com>
Sun, 18 Apr 2010 14:22:14 +0000 (14:22 +0000)
committerBlue Swirl <blauwirbel@gmail.com>
Sun, 18 Apr 2010 14:22:14 +0000 (14:22 +0000)
These clang errors are harmless but worth fixing:
  CC    ppc-softmmu/usb-ohci.o
/src/qemu/hw/usb-ohci.c:1104:59: error: if statement has empty body [-Wempty-body]
                          ohci->ctrl_head, ohci->ctrl_cur);
/src/qemu/hw/usb-ohci.c:1371:57: error: if statement has empty body [-Wempty-body]
        DPRINTF("usb-ohci: port %d: SUSPEND\n", portnum);
  CC    sparc64-softmmu/translate.o
/src/qemu/target-sparc/translate.c:3173:37: error: if statement has empty body [-Wempty-body]
                                    ; // XXX

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
hw/usb-ohci.c
target-sparc/translate.c

index 034acd8..7cd5ca0 100644 (file)
@@ -1099,9 +1099,10 @@ static void ohci_sof(OHCIState *ohci)
 static void ohci_process_lists(OHCIState *ohci, int completion)
 {
     if ((ohci->ctl & OHCI_CTL_CLE) && (ohci->status & OHCI_STATUS_CLF)) {
-        if (ohci->ctrl_cur && ohci->ctrl_cur != ohci->ctrl_head)
-          DPRINTF("usb-ohci: head %x, cur %x\n",
-                          ohci->ctrl_head, ohci->ctrl_cur);
+        if (ohci->ctrl_cur && ohci->ctrl_cur != ohci->ctrl_head) {
+            DPRINTF("usb-ohci: head %x, cur %x\n",
+                    ohci->ctrl_head, ohci->ctrl_cur);
+        }
         if (!ohci_service_ed_list(ohci, ohci->ctrl_head, completion)) {
             ohci->ctrl_cur = 0;
             ohci->status &= ~OHCI_STATUS_CLF;
@@ -1367,8 +1368,9 @@ static void ohci_port_set_status(OHCIState *ohci, int portnum, uint32_t val)
 
     ohci_port_set_if_connected(ohci, portnum, val & OHCI_PORT_PES);
 
-    if (ohci_port_set_if_connected(ohci, portnum, val & OHCI_PORT_PSS))
+    if (ohci_port_set_if_connected(ohci, portnum, val & OHCI_PORT_PSS)) {
         DPRINTF("usb-ohci: port %d: SUSPEND\n", portnum);
+    }
 
     if (ohci_port_set_if_connected(ohci, portnum, val & OHCI_PORT_PRS)) {
         DPRINTF("usb-ohci: port %d: RESET\n", portnum);
index 4f25278..b54c520 100644 (file)
@@ -3169,8 +3169,9 @@ static void disas_sparc_insn(DisasContext * dc)
                                 break;
                             case 0xf: /* V9 sir, nop if user */
 #if !defined(CONFIG_USER_ONLY)
-                                if (supervisor(dc))
+                                if (supervisor(dc)) {
                                     ; // XXX
+                                }
 #endif
                                 break;
                             case 0x13: /* Graphics Status */