From: BALATON Zoltan Date: Tue, 17 Mar 2020 15:05:37 +0000 (+0100) Subject: hw/ide/pci.c: Coding style update to fix checkpatch errors X-Git-Tag: v5.0.0-rc0~22^2~3 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=417adc2d50937b95e5e89d8939f13d7e85d5ad9d;p=thirdparty%2Fqemu.git hw/ide/pci.c: Coding style update to fix checkpatch errors Spaces are required around a + operator and if statements should have braces even for single line. Also make it simpler by reversing the condition instead of breaking the loop. Signed-off-by: BALATON Zoltan Reviewed-by: Mark Cave-Ayland Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Markus Armbruster Message-id: 0d50336ab26a56240c8c17ca1ec6135a4092fcc9.1584457537.git.balaton@eik.bme.hu Signed-off-by: John Snow --- diff --git a/hw/ide/pci.c b/hw/ide/pci.c index 4fc76c52252..e0c84392e28 100644 --- a/hw/ide/pci.c +++ b/hw/ide/pci.c @@ -485,9 +485,9 @@ void pci_ide_create_devs(PCIDevice *dev, DriveInfo **hd_table) int i; for (i = 0; i < 4; i++) { - if (hd_table[i] == NULL) - continue; - ide_create_drive(d->bus+bus[i], unit[i], hd_table[i]); + if (hd_table[i]) { + ide_create_drive(d->bus + bus[i], unit[i], hd_table[i]); + } } }