aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorSam Ravnborg <sam@ravnborg.org>2008-02-26 15:50:33 -0500
committerBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2008-02-26 15:50:33 -0500
commitb66cae7672996c1ed0c4c4a4df04ce7b275c61f6 (patch)
treee4b723ca538ffa6a49642a3dba33e19e5503093d /drivers
parentacbe44e6274e88a14a68df511d87890846a9bc99 (diff)
hpt366: fix section mismatch warnings
hpt366: fix section mismatch warnings Fix following warnings: WARNING: o-sparc64/vmlinux.o(.data+0x195a38): Section mismatch in reference from the variable hpt37x_info.0 to the variable .devinit.data:hpt370 WARNING: o-sparc64/vmlinux.o(.data+0x195a40): Section mismatch in reference from the variable hpt37x_info.0 to the variable .devinit.data:hpt370a WARNING: o-sparc64/vmlinux.o(.data+0x195a48): Section mismatch in reference from the variable hpt37x_info.0 to the variable .devinit.data:hpt372 WARNING: o-sparc64/vmlinux.o(.data+0x195a50): Section mismatch in reference from the variable hpt37x_info.0 to the variable .devinit.data:hpt372n Replace a static array with a small switch resulting in more readable code. Mark the pci table __devinitconst. A lot of variables are const but annotated __devinitdata. Annotating them __devinitconst would cause a section type conflict error when build for 64 bit powerpc. Signed-off-by: Sam Ravnborg <sam@ravnborg.org> Cc: Sergei Shtylyov <sshtylyov@ru.mvista.com> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/ide/pci/hpt366.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/drivers/ide/pci/hpt366.c b/drivers/ide/pci/hpt366.c
index d0f7bb8b8adf..6357bb6269ab 100644
--- a/drivers/ide/pci/hpt366.c
+++ b/drivers/ide/pci/hpt366.c
@@ -1570,10 +1570,12 @@ static int __devinit hpt366_init_one(struct pci_dev *dev, const struct pci_devic
1570 if (rev < 3) 1570 if (rev < 3)
1571 info = &hpt36x; 1571 info = &hpt36x;
1572 else { 1572 else {
1573 static const struct hpt_info *hpt37x_info[] = 1573 switch (min_t(u8, rev, 6)) {
1574 { &hpt370, &hpt370a, &hpt372, &hpt372n }; 1574 case 3: info = &hpt370; break;
1575 1575 case 4: info = &hpt370a; break;
1576 info = hpt37x_info[min_t(u8, rev, 6) - 3]; 1576 case 5: info = &hpt372; break;
1577 case 6: info = &hpt372n; break;
1578 }
1577 idx++; 1579 idx++;
1578 } 1580 }
1579 break; 1581 break;
@@ -1626,7 +1628,7 @@ static int __devinit hpt366_init_one(struct pci_dev *dev, const struct pci_devic
1626 return ide_setup_pci_device(dev, &d); 1628 return ide_setup_pci_device(dev, &d);
1627} 1629}
1628 1630
1629static const struct pci_device_id hpt366_pci_tbl[] = { 1631static const struct pci_device_id hpt366_pci_tbl[] __devinitconst = {
1630 { PCI_VDEVICE(TTI, PCI_DEVICE_ID_TTI_HPT366), 0 }, 1632 { PCI_VDEVICE(TTI, PCI_DEVICE_ID_TTI_HPT366), 0 },
1631 { PCI_VDEVICE(TTI, PCI_DEVICE_ID_TTI_HPT372), 1 }, 1633 { PCI_VDEVICE(TTI, PCI_DEVICE_ID_TTI_HPT372), 1 },
1632 { PCI_VDEVICE(TTI, PCI_DEVICE_ID_TTI_HPT302), 2 }, 1634 { PCI_VDEVICE(TTI, PCI_DEVICE_ID_TTI_HPT302), 2 },