We should only claim that something is a cast if we did not encouter a
token before, that did set av_pending.
This fixes the operator * in the line below to be detected as binary (vs
unary).
kmalloc(sizeof(struct alphatrack_ocmd) * true_size, GFP_KERNEL);
Reported-by: Peter Chubb <nicta.com.au>
Signed-off-by: Florian Mickler <florian@mickler.org>
(cherry-picked from Linux kernel commit c023e4734c3e8801e0ecb5e81b831d42a374d861)
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Cc: Blue Swirl <blauwirbel@gmail.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
There are 508 non-indented (non-default) labels, and 511 that are
indented. So the rule is debatable at least. Actually, in the
common case of labels at the outermost scope, there is really just
one place where to put the label, so the rule is just wrong IMHO.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
checkpatch.pl doesn't report warning for if/else statements with missing
'else' braces:
if (something) {
foo;
} else
bar;
The patch has been tested using the last 100 commits.
Signed-off-by: Pavel Borzenkov <pavel.borzenkov@gmail.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
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 <kwolf@redhat.com>
Signed-off-by: Alexander Graf <agraf@suse.de>
Change checkpatch.pl for QEMU use:
- Root directory detection
- Forbid tabs
- Indent at 4 spaces
- Allow typedefs
- Enforce brace use even for single statement blocks
- Don't suggest nonexistent cleanup tools
Mention the script in CODING_STYLE.
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>