From: "Philippe Mathieu-Daudé" <philmd@redhat.com>
To: qemu-devel@nongnu.org
Cc: "Peter Maydell" <peter.maydell@linaro.org>,
"Thomas Huth" <thuth@redhat.com>,
qemu-arm@nongnu.org, "Gerd Hoffmann" <kraxel@redhat.com>,
"Paolo Bonzini" <pbonzini@redhat.com>,
"Miroslav Rezanina" <mrezanin@redhat.com>,
"Philippe Mathieu-Daudé" <philmd@redhat.com>
Subject: [Qemu-devel] [PATCH-for-4.1? 4/7] vl: Fix 'braces' coding style issues
Date: Fri, 12 Jul 2019 15:39:25 +0200 [thread overview]
Message-ID: <20190712133928.21394-5-philmd@redhat.com> (raw)
In-Reply-To: <20190712133928.21394-1-philmd@redhat.com>
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é <philmd@redhat.com>
---
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
next prev parent reply other threads:[~2019-07-12 13:40 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-07-12 13:39 [Qemu-devel] [PATCH-for-4.1? 0/7] vl: Allow building with CONFIG_BLUETOOTH disabled Philippe Mathieu-Daudé
2019-07-12 13:39 ` [Qemu-devel] [PATCH-for-4.1? 1/7] hw/arm: Nokia N-series tablet requires Bluetooth Philippe Mathieu-Daudé
2019-07-15 13:05 ` Thomas Huth
2019-07-12 13:39 ` [Qemu-devel] [PATCH-for-4.1 2/7] hw/usb: Bluetooth HCI USB depends on USB & BLUETOOTH Philippe Mathieu-Daudé
2019-07-12 13:58 ` Paolo Bonzini
2019-07-12 14:16 ` Philippe Mathieu-Daudé
2019-07-12 14:58 ` Paolo Bonzini
2019-07-12 16:45 ` Philippe Mathieu-Daudé
2019-07-12 17:31 ` Paolo Bonzini
2019-07-14 16:01 ` Philippe Mathieu-Daudé
2019-07-12 13:39 ` [Qemu-devel] [PATCH-for-4.1? 3/7] MAINTAINERS: Add an entry for the Bluetooth devices Philippe Mathieu-Daudé
2019-08-14 12:47 ` Philippe Mathieu-Daudé
2019-07-12 13:39 ` Philippe Mathieu-Daudé [this message]
2019-07-12 13:39 ` [Qemu-devel] [PATCH-for-4.1? 5/7] vl: Use qemu_strtoi() instead of strtol() Philippe Mathieu-Daudé
2019-07-12 13:39 ` [Qemu-devel] [PATCH-for-4.1? 6/7] vl: Extract bt_parse() into its own file Philippe Mathieu-Daudé
2019-07-12 13:39 ` [Qemu-devel] [PATCH-for-4.1? 7/7] hw/bt: Allow building with CONFIG_BLUETOOTH disabled Philippe Mathieu-Daudé
2019-07-15 13:08 ` Thomas Huth
2019-07-14 11:04 ` [Qemu-devel] [PATCH-for-4.1? 0/7] vl: " Richard Henderson
2019-07-15 13:13 ` Thomas Huth
2019-08-13 14:00 ` Philippe Mathieu-Daudé
2019-08-13 14:04 ` Peter Maydell
2019-08-14 12:45 ` Philippe Mathieu-Daudé
2019-11-07 19:09 ` Philippe Mathieu-Daudé
2019-11-07 19:31 ` Thomas Huth
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20190712133928.21394-5-philmd@redhat.com \
--to=philmd@redhat.com \
--cc=kraxel@redhat.com \
--cc=mrezanin@redhat.com \
--cc=pbonzini@redhat.com \
--cc=peter.maydell@linaro.org \
--cc=qemu-arm@nongnu.org \
--cc=qemu-devel@nongnu.org \
--cc=thuth@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).