aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorJeff Garzik <jeff@garzik.org>2006-10-01 10:38:22 -0400
committerJeff Garzik <jeff@garzik.org>2006-10-01 10:38:22 -0400
commit15a7c3bbe344d75e4891c7d30595899c12ccfaa1 (patch)
treedde621ec1c563a112d91f56aaa737e9ceb3c8a8b /drivers
parente993835441734c184d70d3716eed78a08eeb71c2 (diff)
[libata] pata_artop: kill gcc warning
gcc complains thusly: drivers/ata/pata_artop.c: In function ‘artop_init_one’: drivers/ata/pata_artop.c:429: warning: ‘info’ may be used uninitialized in this function While this warning is indeed bogus, even with improved static analysis and value range propagation, gcc will probably never be able to detect this. Add a BUG_ON() to trap invalid driver_data entries in the PCI table. Signed-off-by: Jeff Garzik <jeff@garzik.org>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/ata/pata_artop.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/ata/pata_artop.c b/drivers/ata/pata_artop.c
index 49565ef945f8..690828eb5226 100644
--- a/drivers/ata/pata_artop.c
+++ b/drivers/ata/pata_artop.c
@@ -426,7 +426,7 @@ static int artop_init_one (struct pci_dev *pdev, const struct pci_device_id *id)
426 .port_ops = &artop6260_ops, 426 .port_ops = &artop6260_ops,
427 }; 427 };
428 struct ata_port_info *port_info[2]; 428 struct ata_port_info *port_info[2];
429 struct ata_port_info *info; 429 struct ata_port_info *info = NULL;
430 int ports = 2; 430 int ports = 2;
431 431
432 if (!printed_version++) 432 if (!printed_version++)
@@ -470,6 +470,9 @@ static int artop_init_one (struct pci_dev *pdev, const struct pci_device_id *id)
470 pci_write_config_byte(pdev, 0x4a, (reg & ~0x01) | 0x80); 470 pci_write_config_byte(pdev, 0x4a, (reg & ~0x01) | 0x80);
471 471
472 } 472 }
473
474 BUG_ON(info == NULL);
475
473 port_info[0] = port_info[1] = info; 476 port_info[0] = port_info[1] = info;
474 return ata_pci_init_one(pdev, port_info, ports); 477 return ata_pci_init_one(pdev, port_info, ports);
475} 478}