aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ata
diff options
context:
space:
mode:
authorHarvey Harrison <harvey.harrison@gmail.com>2008-02-14 12:36:32 -0500
committerJeff Garzik <jeff@garzik.org>2008-02-20 12:08:15 -0500
commitcb616dd5bb6ddadf3e0607696b18055065ce4c3d (patch)
treec5c47ac17c9f9ebf6c02fb535ddf4438e1fcbc5e /drivers/ata
parent5d9c4a7de64d398604a978d267a6987f1f4025b7 (diff)
ata: fix sparse warnings in pata_legacy.c
Use ld_qdi and ld_winbond to avoid shadowing static int variables qdi and winbond. The ld_ prefix refers to legacy_data. drivers/ata/pata_legacy.c:777:21: warning: symbol 'qdi' shadows an earlier one drivers/ata/pata_legacy.c:128:12: originally declared here drivers/ata/pata_legacy.c:811:21: warning: symbol 'qdi' shadows an earlier one drivers/ata/pata_legacy.c:128:12: originally declared here drivers/ata/pata_legacy.c:848:21: warning: symbol 'qdi' shadows an earlier one drivers/ata/pata_legacy.c:128:12: originally declared here drivers/ata/pata_legacy.c:882:21: warning: symbol 'qdi' shadows an earlier one drivers/ata/pata_legacy.c:128:12: originally declared here drivers/ata/pata_legacy.c:1040:21: warning: symbol 'winbond' shadows an earlier one drivers/ata/pata_legacy.c:129:12: originally declared here Signed-off-by: Harvey Harrison <harvey.harrison@gmail.com> Signed-off-by: Jeff Garzik <jeff@garzik.org>
Diffstat (limited to 'drivers/ata')
-rw-r--r--drivers/ata/pata_legacy.c44
1 files changed, 22 insertions, 22 deletions
diff --git a/drivers/ata/pata_legacy.c b/drivers/ata/pata_legacy.c
index d2177f75078a..50fe08ebe23c 100644
--- a/drivers/ata/pata_legacy.c
+++ b/drivers/ata/pata_legacy.c
@@ -774,14 +774,14 @@ static struct ata_port_operations opti82c46x_port_ops = {
774static void qdi6500_set_piomode(struct ata_port *ap, struct ata_device *adev) 774static void qdi6500_set_piomode(struct ata_port *ap, struct ata_device *adev)
775{ 775{
776 struct ata_timing t; 776 struct ata_timing t;
777 struct legacy_data *qdi = ap->host->private_data; 777 struct legacy_data *ld_qdi = ap->host->private_data;
778 int active, recovery; 778 int active, recovery;
779 u8 timing; 779 u8 timing;
780 780
781 /* Get the timing data in cycles */ 781 /* Get the timing data in cycles */
782 ata_timing_compute(adev, adev->pio_mode, &t, 30303, 1000); 782 ata_timing_compute(adev, adev->pio_mode, &t, 30303, 1000);
783 783
784 if (qdi->fast) { 784 if (ld_qdi->fast) {
785 active = 8 - FIT(t.active, 1, 8); 785 active = 8 - FIT(t.active, 1, 8);
786 recovery = 18 - FIT(t.recover, 3, 18); 786 recovery = 18 - FIT(t.recover, 3, 18);
787 } else { 787 } else {
@@ -790,9 +790,9 @@ static void qdi6500_set_piomode(struct ata_port *ap, struct ata_device *adev)
790 } 790 }
791 timing = (recovery << 4) | active | 0x08; 791 timing = (recovery << 4) | active | 0x08;
792 792
793 qdi->clock[adev->devno] = timing; 793 ld_qdi->clock[adev->devno] = timing;
794 794
795 outb(timing, qdi->timing); 795 outb(timing, ld_qdi->timing);
796} 796}
797 797
798/** 798/**
@@ -808,14 +808,14 @@ static void qdi6500_set_piomode(struct ata_port *ap, struct ata_device *adev)
808static void qdi6580dp_set_piomode(struct ata_port *ap, struct ata_device *adev) 808static void qdi6580dp_set_piomode(struct ata_port *ap, struct ata_device *adev)
809{ 809{
810 struct ata_timing t; 810 struct ata_timing t;
811 struct legacy_data *qdi = ap->host->private_data; 811 struct legacy_data *ld_qdi = ap->host->private_data;
812 int active, recovery; 812 int active, recovery;
813 u8 timing; 813 u8 timing;
814 814
815 /* Get the timing data in cycles */ 815 /* Get the timing data in cycles */
816 ata_timing_compute(adev, adev->pio_mode, &t, 30303, 1000); 816 ata_timing_compute(adev, adev->pio_mode, &t, 30303, 1000);
817 817
818 if (qdi->fast) { 818 if (ld_qdi->fast) {
819 active = 8 - FIT(t.active, 1, 8); 819 active = 8 - FIT(t.active, 1, 8);
820 recovery = 18 - FIT(t.recover, 3, 18); 820 recovery = 18 - FIT(t.recover, 3, 18);
821 } else { 821 } else {
@@ -824,12 +824,12 @@ static void qdi6580dp_set_piomode(struct ata_port *ap, struct ata_device *adev)
824 } 824 }
825 timing = (recovery << 4) | active | 0x08; 825 timing = (recovery << 4) | active | 0x08;
826 826
827 qdi->clock[adev->devno] = timing; 827 ld_qdi->clock[adev->devno] = timing;
828 828
829 outb(timing, qdi->timing + 2 * ap->port_no); 829 outb(timing, ld_qdi->timing + 2 * ap->port_no);
830 /* Clear the FIFO */ 830 /* Clear the FIFO */
831 if (adev->class != ATA_DEV_ATA) 831 if (adev->class != ATA_DEV_ATA)
832 outb(0x5F, qdi->timing + 3); 832 outb(0x5F, ld_qdi->timing + 3);
833} 833}
834 834
835/** 835/**
@@ -845,14 +845,14 @@ static void qdi6580dp_set_piomode(struct ata_port *ap, struct ata_device *adev)
845static void qdi6580_set_piomode(struct ata_port *ap, struct ata_device *adev) 845static void qdi6580_set_piomode(struct ata_port *ap, struct ata_device *adev)
846{ 846{
847 struct ata_timing t; 847 struct ata_timing t;
848 struct legacy_data *qdi = ap->host->private_data; 848 struct legacy_data *ld_qdi = ap->host->private_data;
849 int active, recovery; 849 int active, recovery;
850 u8 timing; 850 u8 timing;
851 851
852 /* Get the timing data in cycles */ 852 /* Get the timing data in cycles */
853 ata_timing_compute(adev, adev->pio_mode, &t, 30303, 1000); 853 ata_timing_compute(adev, adev->pio_mode, &t, 30303, 1000);
854 854
855 if (qdi->fast) { 855 if (ld_qdi->fast) {
856 active = 8 - FIT(t.active, 1, 8); 856 active = 8 - FIT(t.active, 1, 8);
857 recovery = 18 - FIT(t.recover, 3, 18); 857 recovery = 18 - FIT(t.recover, 3, 18);
858 } else { 858 } else {
@@ -860,11 +860,11 @@ static void qdi6580_set_piomode(struct ata_port *ap, struct ata_device *adev)
860 recovery = 15 - FIT(t.recover, 0, 15); 860 recovery = 15 - FIT(t.recover, 0, 15);
861 } 861 }
862 timing = (recovery << 4) | active | 0x08; 862 timing = (recovery << 4) | active | 0x08;
863 qdi->clock[adev->devno] = timing; 863 ld_qdi->clock[adev->devno] = timing;
864 outb(timing, qdi->timing + 2 * adev->devno); 864 outb(timing, ld_qdi->timing + 2 * adev->devno);
865 /* Clear the FIFO */ 865 /* Clear the FIFO */
866 if (adev->class != ATA_DEV_ATA) 866 if (adev->class != ATA_DEV_ATA)
867 outb(0x5F, qdi->timing + 3); 867 outb(0x5F, ld_qdi->timing + 3);
868} 868}
869 869
870/** 870/**
@@ -879,12 +879,12 @@ static unsigned int qdi_qc_issue_prot(struct ata_queued_cmd *qc)
879{ 879{
880 struct ata_port *ap = qc->ap; 880 struct ata_port *ap = qc->ap;
881 struct ata_device *adev = qc->dev; 881 struct ata_device *adev = qc->dev;
882 struct legacy_data *qdi = ap->host->private_data; 882 struct legacy_data *ld_qdi = ap->host->private_data;
883 883
884 if (qdi->clock[adev->devno] != qdi->last) { 884 if (ld_qdi->clock[adev->devno] != ld_qdi->last) {
885 if (adev->pio_mode) { 885 if (adev->pio_mode) {
886 qdi->last = qdi->clock[adev->devno]; 886 ld_qdi->last = ld_qdi->clock[adev->devno];
887 outb(qdi->clock[adev->devno], qdi->timing + 887 outb(ld_qdi->clock[adev->devno], ld_qdi->timing +
888 2 * ap->port_no); 888 2 * ap->port_no);
889 } 889 }
890 } 890 }
@@ -1037,12 +1037,12 @@ static u8 winbond_readcfg(unsigned long port, u8 reg)
1037static void winbond_set_piomode(struct ata_port *ap, struct ata_device *adev) 1037static void winbond_set_piomode(struct ata_port *ap, struct ata_device *adev)
1038{ 1038{
1039 struct ata_timing t; 1039 struct ata_timing t;
1040 struct legacy_data *winbond = ap->host->private_data; 1040 struct legacy_data *ld_winbond = ap->host->private_data;
1041 int active, recovery; 1041 int active, recovery;
1042 u8 reg; 1042 u8 reg;
1043 int timing = 0x88 + (ap->port_no * 4) + (adev->devno * 2); 1043 int timing = 0x88 + (ap->port_no * 4) + (adev->devno * 2);
1044 1044
1045 reg = winbond_readcfg(winbond->timing, 0x81); 1045 reg = winbond_readcfg(ld_winbond->timing, 0x81);
1046 1046
1047 /* Get the timing data in cycles */ 1047 /* Get the timing data in cycles */
1048 if (reg & 0x40) /* Fast VLB bus, assume 50MHz */ 1048 if (reg & 0x40) /* Fast VLB bus, assume 50MHz */
@@ -1053,7 +1053,7 @@ static void winbond_set_piomode(struct ata_port *ap, struct ata_device *adev)
1053 active = (FIT(t.active, 3, 17) - 1) & 0x0F; 1053 active = (FIT(t.active, 3, 17) - 1) & 0x0F;
1054 recovery = (FIT(t.recover, 1, 15) + 1) & 0x0F; 1054 recovery = (FIT(t.recover, 1, 15) + 1) & 0x0F;
1055 timing = (active << 4) | recovery; 1055 timing = (active << 4) | recovery;
1056 winbond_writecfg(winbond->timing, timing, reg); 1056 winbond_writecfg(ld_winbond->timing, timing, reg);
1057 1057
1058 /* Load the setup timing */ 1058 /* Load the setup timing */
1059 1059
@@ -1063,7 +1063,7 @@ static void winbond_set_piomode(struct ata_port *ap, struct ata_device *adev)
1063 if (!ata_pio_need_iordy(adev)) 1063 if (!ata_pio_need_iordy(adev))
1064 reg |= 0x02; /* IORDY off */ 1064 reg |= 0x02; /* IORDY off */
1065 reg |= (FIT(t.setup, 0, 3) << 6); 1065 reg |= (FIT(t.setup, 0, 3) << 6);
1066 winbond_writecfg(winbond->timing, timing + 1, reg); 1066 winbond_writecfg(ld_winbond->timing, timing + 1, reg);
1067} 1067}
1068 1068
1069static int winbond_port(struct platform_device *dev, 1069static int winbond_port(struct platform_device *dev,