[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 10/13] pci: Fix coding style of pci_parse_devaddr
From: |
Jan Kiszka |
Subject: |
[Qemu-devel] [PATCH 10/13] pci: Fix coding style of pci_parse_devaddr |
Date: |
Mon, 4 Jun 2012 10:52:18 +0200 |
So that we can move it unmodified without raising alarms. No functional
changes.
Signed-off-by: Jan Kiszka <address@hidden>
---
hw/pci.c | 52 ++++++++++++++++++++++++++++------------------------
1 files changed, 28 insertions(+), 24 deletions(-)
diff --git a/hw/pci.c b/hw/pci.c
index 4d700a9..62ad61c 100644
--- a/hw/pci.c
+++ b/hw/pci.c
@@ -524,43 +524,47 @@ int pci_parse_devaddr(const char *addrstr,
PCIDeviceAddress *addr,
p = addrstr;
val = strtoul(p, &e, 16);
- if (e == p)
- return -1;
+ if (e == p) {
+ return -1;
+ }
if (*e == ':') {
- bus = val;
- p = e + 1;
- val = strtoul(p, &e, 16);
- if (e == p)
- return -1;
- if (*e == ':') {
- dom = bus;
- bus = val;
- p = e + 1;
- val = strtoul(p, &e, 16);
- if (e == p)
- return -1;
- }
+ bus = val;
+ p = e + 1;
+ val = strtoul(p, &e, 16);
+ if (e == p) {
+ return -1;
+ }
+ if (*e == ':') {
+ dom = bus;
+ bus = val;
+ p = e + 1;
+ val = strtoul(p, &e, 16);
+ if (e == p) {
+ return -1;
+ }
+ }
}
slot = val;
if (flags & PCI_DEVADDR_WITH_FUNC) {
- if (*e != '.')
+ if (*e != '.') {
return -1;
-
+ }
p = e + 1;
val = strtoul(p, &e, 16);
- if (e == p)
+ if (e == p) {
return -1;
-
+ }
func = val;
}
- if (dom > 0xffff || bus > 0xff || slot > 0x1f || func > 7)
- return -1;
-
- if (*e)
- return -1;
+ if (dom > 0xffff || bus > 0xff || slot > 0x1f || func > 7) {
+ return -1;
+ }
+ if (*e) {
+ return -1;
+ }
addr->domain = dom;
addr->bus = bus;
--
1.7.3.4
- [Qemu-devel] [PATCH 00/13] pci: Cleanups & preparations for KVM device assignment, Jan Kiszka, 2012/06/04
- [Qemu-devel] [PATCH 02/13] pci: Fold pci_bus_new_inplace into pci_bus_new, Jan Kiszka, 2012/06/04
- [Qemu-devel] [PATCH 10/13] pci: Fix coding style of pci_parse_devaddr,
Jan Kiszka <=
- [Qemu-devel] [PATCH 03/13] pci: Introduce cached device INTx routing, Jan Kiszka, 2012/06/04
- [Qemu-devel] [PATCH 11/13] Move pci_parse_devaddr to qdev-properties, Jan Kiszka, 2012/06/04
- Re: [Qemu-devel] [PATCH 11/13] Move pci_parse_devaddr to qdev-properties, Andreas Färber, 2012/06/07
- Re: [Qemu-devel] [PATCH 11/13] Move pci_parse_devaddr to qdev-properties, Jan Kiszka, 2012/06/07
- Re: [Qemu-devel] [PATCH 11/13] Move pci_parse_devaddr to qdev-properties, Andreas Färber, 2012/06/07
- Re: [Qemu-devel] [PATCH 11/13] Move pci_parse_devaddr to qdev-properties, Jan Kiszka, 2012/06/08
- Re: [Qemu-devel] [PATCH 11/13] Move pci_parse_devaddr to qdev-properties, Andreas Färber, 2012/06/08
- Re: [Qemu-devel] [PATCH 11/13] Move pci_parse_devaddr to qdev-properties, Jan Kiszka, 2012/06/08
- Re: [Qemu-devel] [PATCH 11/13] Move pci_parse_devaddr to qdev-properties, Andreas Färber, 2012/06/08