Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

ata: pata_artop: use *switch* in atp8xx_fixup()

This driver uses a string of the *if* statements in atp8xx_fixup() where
a *switch* statement would fit better...

Signed-off-by: Sergey Shtylyov <s.shtylyov@omp.ru>
Signed-off-by: Damien Le Moal <damien.lemoal@opensource.wdc.com>

authored by

Sergey Shtylyov and committed by
Damien Le Moal
7ad3128e 183a4bfb

+9 -5
+9 -5
drivers/ata/pata_artop.c
··· 28 28 #include <linux/ata.h> 29 29 30 30 #define DRV_NAME "pata_artop" 31 - #define DRV_VERSION "0.4.7" 31 + #define DRV_VERSION "0.4.8" 32 32 33 33 /* 34 34 * The ARTOP has 33 Mhz and "over clocked" timing tables. Until we ··· 315 315 316 316 static void atp8xx_fixup(struct pci_dev *pdev) 317 317 { 318 - if (pdev->device == 0x0005) 318 + u8 reg; 319 + 320 + switch (pdev->device) { 321 + case 0x0005: 319 322 /* BIOS may have left us in UDMA, clear it before libata probe */ 320 323 pci_write_config_byte(pdev, 0x54, 0); 321 - else if (pdev->device == 0x0008 || pdev->device == 0x0009) { 322 - u8 reg; 323 - 324 + break; 325 + case 0x0008: 326 + case 0x0009: 324 327 /* Mac systems come up with some registers not set as we 325 328 will need them */ 326 329 ··· 341 338 /* Enable IRQ output and burst mode */ 342 339 pci_read_config_byte(pdev, 0x4a, &reg); 343 340 pci_write_config_byte(pdev, 0x4a, (reg & ~0x01) | 0x80); 341 + break; 344 342 } 345 343 } 346 344