From adf040ddd00152bda99aa9bc2afef9075ac88b34 Mon Sep 17 00:00:00 2001 From: Rob Herring Date: Wed, 5 Dec 2018 13:50:25 -0600 Subject: [PATCH 1/4] ide: Use of_node_name_eq for node name comparisons Convert string compares of DT node names to use of_node_name_eq helper instead. This removes direct access to the node name pointer. Cc: "David S. Miller" Cc: Benjamin Herrenschmidt Cc: Paul Mackerras Cc: Michael Ellerman Cc: linux-ide@vger.kernel.org Cc: linuxppc-dev@lists.ozlabs.org Signed-off-by: Rob Herring Signed-off-by: David S. Miller --- drivers/ide/pmac.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/ide/pmac.c b/drivers/ide/pmac.c index 203ed4adc04a..92f840365718 100644 --- a/drivers/ide/pmac.c +++ b/drivers/ide/pmac.c @@ -1046,7 +1046,7 @@ static int pmac_ide_setup_device(pmac_ide_hwif_t *pmif, struct ide_hw *hw) d.port_ops = &pmac_ide_ata4_port_ops; d.udma_mask = ATA_UDMA5; } else if (of_device_is_compatible(np, "keylargo-ata")) { - if (strcmp(np->name, "ata-4") == 0) { + if (of_node_name_eq(np, "ata-4")) { pmif->kind = controller_kl_ata4; d.port_ops = &pmac_ide_ata4_port_ops; d.udma_mask = ATA_UDMA4; From 498b58944c4ea227e4b43d56814c1fadf9b78438 Mon Sep 17 00:00:00 2001 From: "Gustavo A. R. Silva" Date: Thu, 10 Jan 2019 10:34:23 -0600 Subject: [PATCH 2/4] ide: hpt366: mark expected switch fall-throughs In preparation to enabling -Wimplicit-fallthrough, mark switch cases where we are expecting to fall through. Notice that, in this particular case, I removed the "else: " part from the comment. As we are now using Warning level 3: -Wimplicit-fallthrough=3, this is what GCC is expecting to find. Signed-off-by: Gustavo A. R. Silva Signed-off-by: David S. Miller --- drivers/ide/hpt366.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/ide/hpt366.c b/drivers/ide/hpt366.c index 4d565b0c5a6e..0a3f9bcc8b04 100644 --- a/drivers/ide/hpt366.c +++ b/drivers/ide/hpt366.c @@ -574,7 +574,7 @@ static u8 hpt3xx_udma_filter(ide_drive_t *drive) if (!HPT370_ALLOW_ATA100_5 || check_in_drive_list(drive, bad_ata100_5)) return ATA_UDMA4; - /* else: fall through */ + /* fall through */ case HPT372 : case HPT372A: case HPT372N: @@ -601,7 +601,7 @@ static u8 hpt3xx_mdma_filter(ide_drive_t *drive) case HPT374 : if (ata_id_is_sata(drive->id)) return 0x00; - /* else: fall through */ + /* fall through */ default: return 0x07; } From fbf68b01a83ee9d1c25e8385a2e9a43b6d919dea Mon Sep 17 00:00:00 2001 From: "Gustavo A. R. Silva" Date: Mon, 11 Feb 2019 16:17:20 -0600 Subject: [PATCH 3/4] ide: mark expected switch fall-through MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit In preparation to enabling -Wimplicit-fallthrough, mark switch cases where we are expecting to fall through. This patch fixes the following warning: drivers/ide/ide-floppy.c: In function ‘ide_floppy_get_capacity’: drivers/ide/ide-floppy.c:424:7: warning: this statement may fall through [-Wimplicit-fallthrough=] if (!(drive->atapi_flags & IDE_AFLAG_CLIK_DRIVE)) ^ drivers/ide/ide-floppy.c:431:3: note: here case CAPACITY_CURRENT: ^~~~ Warning level 3 was used: -Wimplicit-fallthrough=3 Notice that, in this particular case, the code comment is modified in accordance with what GCC is expecting to find. This patch is part of the ongoing efforts to enable -Wimplicit-fallthrough. Signed-off-by: Gustavo A. R. Silva Signed-off-by: David S. Miller --- drivers/ide/ide-floppy.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/ide/ide-floppy.c b/drivers/ide/ide-floppy.c index a8df300f949c..c04d33d8dc8d 100644 --- a/drivers/ide/ide-floppy.c +++ b/drivers/ide/ide-floppy.c @@ -427,7 +427,7 @@ static int ide_floppy_get_capacity(ide_drive_t *drive) * (maintains previous driver behaviour) */ break; - /* else: fall through */ + /* fall through */ case CAPACITY_CURRENT: /* Normal Zip/LS-120 disks */ if (memcmp(cap_desc, &floppy->cap_desc, 8)) From dc5c37736d16ec90559888fb4c974977fc8ed1ca Mon Sep 17 00:00:00 2001 From: "Enrico Weigelt, metux IT consult" Date: Thu, 7 Mar 2019 02:34:00 +0100 Subject: [PATCH 4/4] drivers: ide: Kconfig: pedantic formatting Formatting of Kconfig files doesn't look so pretty, so just take a damp cloth and clean it up. Signed-off-by: Enrico Weigelt, metux IT consult Signed-off-by: David S. Miller --- drivers/ide/Kconfig | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/drivers/ide/Kconfig b/drivers/ide/Kconfig index 901b8833847f..19fcd0756f46 100644 --- a/drivers/ide/Kconfig +++ b/drivers/ide/Kconfig @@ -320,9 +320,9 @@ config BLK_DEV_OFFBOARD config BLK_DEV_GENERIC tristate "Generic PCI IDE Chipset Support" select BLK_DEV_IDEPCI - help - This option provides generic support for various PCI IDE Chipsets - which otherwise might not be supported. + help + This option provides generic support for various PCI IDE Chipsets + which otherwise might not be supported. config BLK_DEV_OPTI621 tristate "OPTi 82C621 chipset enhanced support" @@ -516,7 +516,7 @@ config BLK_DEV_IT8213 tristate "IT8213 IDE support" select BLK_DEV_IDEDMA_PCI help - This driver adds support for the ITE 8213 IDE controller. + This driver adds support for the ITE 8213 IDE controller. config BLK_DEV_IT821X tristate "IT821X IDE support" @@ -671,20 +671,20 @@ config BLK_DEV_IDE_PMAC_ATA100FIRST hard disk and hdc for CD-ROM. config BLK_DEV_IDE_AU1XXX - bool "IDE for AMD Alchemy Au1200" - depends on MIPS_ALCHEMY - select IDE_XFER_MODE + bool "IDE for AMD Alchemy Au1200" + depends on MIPS_ALCHEMY + select IDE_XFER_MODE choice - prompt "IDE Mode for AMD Alchemy Au1200" - default BLK_DEV_IDE_AU1XXX_PIO_DBDMA - depends on BLK_DEV_IDE_AU1XXX + prompt "IDE Mode for AMD Alchemy Au1200" + default BLK_DEV_IDE_AU1XXX_PIO_DBDMA + depends on BLK_DEV_IDE_AU1XXX config BLK_DEV_IDE_AU1XXX_PIO_DBDMA - bool "PIO+DbDMA IDE for AMD Alchemy Au1200" + bool "PIO+DbDMA IDE for AMD Alchemy Au1200" config BLK_DEV_IDE_AU1XXX_MDMA2_DBDMA - bool "MDMA2+DbDMA IDE for AMD Alchemy Au1200" - depends on BLK_DEV_IDE_AU1XXX + bool "MDMA2+DbDMA IDE for AMD Alchemy Au1200" + depends on BLK_DEV_IDE_AU1XXX endchoice config BLK_DEV_IDE_TX4938