[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 10/12] checkpatch: don't error out on }, { lines
From: |
Alexander Graf |
Subject: |
[Qemu-devel] [PATCH 10/12] checkpatch: don't error out on }, { lines |
Date: |
Tue, 5 Jul 2011 18:51:11 +0200 |
When having code like this:
static PCIDeviceInfo piix_ide_info[] = {
{
.qdev.name = "piix3-ide",
.qdev.size = sizeof(PCIIDEState),
.qdev.no_user = 1,
.no_hotplug = 1,
.init = pci_piix_ide_initfn,
.vendor_id = PCI_VENDOR_ID_INTEL,
.device_id = PCI_DEVICE_ID_INTEL_82371SB_1,
.class_id = PCI_CLASS_STORAGE_IDE,
},{
.qdev.name = "piix4-ide",
.qdev.size = sizeof(PCIIDEState),
.qdev.no_user = 1,
.no_hotplug = 1,
.init = pci_piix_ide_initfn,
.vendor_id = PCI_VENDOR_ID_INTEL,
.device_id = PCI_DEVICE_ID_INTEL_82371AB,
.class_id = PCI_CLASS_STORAGE_IDE,
},{
/* end of list */
}
};
checkpatch currently errors out, claiming that spaces need to follow
commas. However, this particular style of defining structs is pretty
common in qemu code and very readable. So let's declare it as supported
for the above case.
Reported-by: Kevin Wolf <address@hidden>
Signed-off-by: Alexander Graf <address@hidden>
---
scripts/checkpatch.pl | 4 +++-
1 files changed, 3 insertions(+), 1 deletions(-)
diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index 075b614..70a2111 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -2068,8 +2068,10 @@ sub process {
}
# , must have a space on the right.
+ # not required when having a single },{ on one
line
} elsif ($op eq ',') {
- if ($ctx !~ /.x[WEC]/ && $cc !~ /^}/) {
+ if ($ctx !~ /.x[WEC]/ && $cc !~ /^}/ &&
+ ($elements[$n] . $elements[$n +
2]) !~ " *}{") {
ERROR("space required after
that '$op' $at\n" . $hereptr);
}
--
1.6.0.2
- [Qemu-devel] [PULL 00/12] Xen patch queue 2011-07-05, Alexander Graf, 2011/07/05
- [Qemu-devel] [PATCH 05/12] xen_console: fix memory leak, Alexander Graf, 2011/07/05
- [Qemu-devel] [PATCH 09/12] xen_disk: treat "aio" as "raw", Alexander Graf, 2011/07/05
- [Qemu-devel] [PATCH 08/12] qemu_ram_ptr_length: take ram_addr_t as arguments, Alexander Graf, 2011/07/05
- [Qemu-devel] [PATCH 04/12] xen: enable console and disk backend in HVM mode, Alexander Graf, 2011/07/05
- [Qemu-devel] [PATCH 06/12] xen: add vkbd support for PV on HVM guests, Alexander Graf, 2011/07/05
- [Qemu-devel] [PATCH 02/12] xen: Clean up map cache API naming, Alexander Graf, 2011/07/05
- [Qemu-devel] [PATCH 10/12] checkpatch: don't error out on }, { lines,
Alexander Graf <=
- [Qemu-devel] [PATCH 07/12] xen_disk: cope with missing xenstore "params" node, Alexander Graf, 2011/07/05
- [Qemu-devel] [PATCH 01/12] xen: Clean up build system, Alexander Graf, 2011/07/05
- [Qemu-devel] [PATCH 11/12] xen_console: support the new extended xenstore protocol, Alexander Graf, 2011/07/05
- [Qemu-devel] [PATCH 03/12] xen: Fold CONFIG_XEN_MAPCACHE into CONFIG_XEN, Alexander Graf, 2011/07/05
- [Qemu-devel] [PATCH 12/12] xen_console: fall back to qemu serial device, Alexander Graf, 2011/07/05
- Re: [Qemu-devel] [PULL 00/12] Xen patch queue 2011-07-05, Anthony Liguori, 2011/07/19