qemu-devel
[Top][All Lists]
Advanced

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

[Qemu-devel] [PATCH-for-4.1? 4/7] vl: Fix 'braces' coding style issues


From: Philippe Mathieu-Daudé
Subject: [Qemu-devel] [PATCH-for-4.1? 4/7] vl: Fix 'braces' coding style issues
Date: Fri, 12 Jul 2019 15:39:25 +0200

Since we'll move this code around, fix its style first:

  ERROR: braces {} are necessary for all arms of this statement style

Signed-off-by: Philippe Mathieu-Daudé <address@hidden>
---
 vl.c | 27 ++++++++++++++++++---------
 1 file changed, 18 insertions(+), 9 deletions(-)

diff --git a/vl.c b/vl.c
index 5089fce6c5..96de4f74b9 100644
--- a/vl.c
+++ b/vl.c
@@ -920,8 +920,9 @@ static struct HCIInfo *hci_table[MAX_NICS];
 
 struct HCIInfo *qemu_next_hci(void)
 {
-    if (cur_hci == nb_hcis)
+    if (cur_hci == nb_hcis) {
         return &null_hci;
+    }
 
     return hci_table[cur_hci++];
 }
@@ -937,8 +938,9 @@ static int bt_hci_parse(const char *str)
     }
 
     hci = hci_init(str);
-    if (!hci)
+    if (!hci) {
         return -1;
+    }
 
     bdaddr.b[0] = 0x52;
     bdaddr.b[1] = 0x54;
@@ -957,9 +959,10 @@ static void bt_vhci_add(int vlan_id)
 {
     struct bt_scatternet_s *vlan = qemu_find_bt_vlan(vlan_id);
 
-    if (!vlan->slave)
+    if (!vlan->slave) {
         warn_report("adding a VHCI to an empty scatternet %i",
                     vlan_id);
+    }
 
     bt_vhci_init(bt_new_hci(vlan));
 }
@@ -984,12 +987,14 @@ static struct bt_device_s *bt_device_add(const char *opt)
 
     vlan = qemu_find_bt_vlan(vlan_id);
 
-    if (!vlan->slave)
+    if (!vlan->slave) {
         warn_report("adding a slave device to an empty scatternet %i",
                     vlan_id);
+    }
 
-    if (!strcmp(devname, "keyboard"))
+    if (!strcmp(devname, "keyboard")) {
         return bt_keyboard_init(vlan);
+    }
 
     error_report("unsupported bluetooth device '%s'", devname);
     return 0;
@@ -1002,9 +1007,11 @@ static int bt_parse(const char *opt)
 
     if (strstart(opt, "hci", &endp)) {
         if (!*endp || *endp == ',') {
-            if (*endp)
-                if (!strstart(endp, ",vlan=", 0))
+            if (*endp) {
+                if (!strstart(endp, ",vlan=", 0)) {
                     opt = endp + 1;
+                }
+            }
 
             return bt_hci_parse(opt);
        }
@@ -1021,14 +1028,16 @@ static int bt_parse(const char *opt)
                     error_report("bad parameter '%s'", endp + 1);
                     return 1;
                 }
-            } else
+            } else {
                 vlan = 0;
+            }
 
             bt_vhci_add(vlan);
             return 0;
         }
-    } else if (strstart(opt, "device:", &endp))
+    } else if (strstart(opt, "device:", &endp)) {
         return !bt_device_add(endp);
+    }
 
     error_report("bad bluetooth parameter '%s'", opt);
     return 1;
-- 
2.20.1




reply via email to

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