[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
- [Qemu-devel] [PATCH-for-4.1? 1/7] hw/arm: Nokia N-series tablet requires Bluetooth, (continued)
- [Qemu-devel] [PATCH-for-4.1? 1/7] hw/arm: Nokia N-series tablet requires Bluetooth, Philippe Mathieu-Daudé, 2019/07/12
- [Qemu-devel] [PATCH-for-4.1 2/7] hw/usb: Bluetooth HCI USB depends on USB & BLUETOOTH, Philippe Mathieu-Daudé, 2019/07/12
- Re: [Qemu-devel] [PATCH-for-4.1 2/7] hw/usb: Bluetooth HCI USB depends on USB & BLUETOOTH, Paolo Bonzini, 2019/07/12
- Re: [Qemu-devel] [PATCH-for-4.1 2/7] hw/usb: Bluetooth HCI USB depends on USB & BLUETOOTH, Philippe Mathieu-Daudé, 2019/07/12
- Re: [Qemu-devel] [PATCH-for-4.1 2/7] hw/usb: Bluetooth HCI USB depends on USB & BLUETOOTH, Paolo Bonzini, 2019/07/12
- Re: [Qemu-devel] [PATCH-for-4.1 2/7] hw/usb: Bluetooth HCI USB depends on USB & BLUETOOTH, Philippe Mathieu-Daudé, 2019/07/12
- Re: [Qemu-devel] [PATCH-for-4.1 2/7] hw/usb: Bluetooth HCI USB depends on USB & BLUETOOTH, Paolo Bonzini, 2019/07/12
- Re: [Qemu-devel] [PATCH-for-4.1 2/7] hw/usb: Bluetooth HCI USB depends on USB & BLUETOOTH, Philippe Mathieu-Daudé, 2019/07/14
[Qemu-devel] [PATCH-for-4.1? 3/7] MAINTAINERS: Add an entry for the Bluetooth devices, Philippe Mathieu-Daudé, 2019/07/12
[Qemu-devel] [PATCH-for-4.1? 4/7] vl: Fix 'braces' coding style issues,
Philippe Mathieu-Daudé <=
[Qemu-devel] [PATCH-for-4.1? 5/7] vl: Use qemu_strtoi() instead of strtol(), Philippe Mathieu-Daudé, 2019/07/12
[Qemu-devel] [PATCH-for-4.1? 6/7] vl: Extract bt_parse() into its own file, Philippe Mathieu-Daudé, 2019/07/12
[Qemu-devel] [PATCH-for-4.1? 7/7] hw/bt: Allow building with CONFIG_BLUETOOTH disabled, Philippe Mathieu-Daudé, 2019/07/12
Re: [Qemu-devel] [PATCH-for-4.1? 0/7] vl: Allow building with CONFIG_BLUETOOTH disabled, Richard Henderson, 2019/07/14
Re: [Qemu-devel] [PATCH-for-4.1? 0/7] vl: Allow building with CONFIG_BLUETOOTH disabled, Thomas Huth, 2019/07/15