aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ata/sata_promise.c
diff options
context:
space:
mode:
authorJeff Garzik <jeff@garzik.org>2007-10-26 00:03:37 -0400
committerJeff Garzik <jeff@garzik.org>2007-10-29 06:15:27 -0400
commit5796d1c4c89efff823259fda35b08ea66ebf8b23 (patch)
treef9396980d7a2bfe0fb29303fa90bce66fd87086a /drivers/ata/sata_promise.c
parentb447916e2b8c80f37aa88512ea39a05d5d11507d (diff)
[libata] Address some checkpatch-spotted issues
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
Diffstat (limited to 'drivers/ata/sata_promise.c')
-rw-r--r--drivers/ata/sata_promise.c38
1 files changed, 23 insertions, 15 deletions
diff --git a/drivers/ata/sata_promise.c b/drivers/ata/sata_promise.c
index 903213153b5d..deb26f04f2d7 100644
--- a/drivers/ata/sata_promise.c
+++ b/drivers/ata/sata_promise.c
@@ -83,10 +83,12 @@ enum {
83 PDC_PCI_SYS_ERR = (1 << 22), /* PCI system error */ 83 PDC_PCI_SYS_ERR = (1 << 22), /* PCI system error */
84 PDC1_PCI_PARITY_ERR = (1 << 23), /* PCI parity error (from SATA150 driver) */ 84 PDC1_PCI_PARITY_ERR = (1 << 23), /* PCI parity error (from SATA150 driver) */
85 PDC1_ERR_MASK = PDC1_PCI_PARITY_ERR, 85 PDC1_ERR_MASK = PDC1_PCI_PARITY_ERR,
86 PDC2_ERR_MASK = PDC2_HTO_ERR | PDC2_ATA_HBA_ERR | PDC2_ATA_DMA_CNT_ERR, 86 PDC2_ERR_MASK = PDC2_HTO_ERR | PDC2_ATA_HBA_ERR |
87 PDC_ERR_MASK = (PDC_PH_ERR | PDC_SH_ERR | PDC_DH_ERR | PDC_OVERRUN_ERR 87 PDC2_ATA_DMA_CNT_ERR,
88 | PDC_UNDERRUN_ERR | PDC_DRIVE_ERR | PDC_PCI_SYS_ERR 88 PDC_ERR_MASK = PDC_PH_ERR | PDC_SH_ERR | PDC_DH_ERR |
89 | PDC1_ERR_MASK | PDC2_ERR_MASK), 89 PDC_OVERRUN_ERR | PDC_UNDERRUN_ERR |
90 PDC_DRIVE_ERR | PDC_PCI_SYS_ERR |
91 PDC1_ERR_MASK | PDC2_ERR_MASK,
90 92
91 board_2037x = 0, /* FastTrak S150 TX2plus */ 93 board_2037x = 0, /* FastTrak S150 TX2plus */
92 board_2037x_pata = 1, /* FastTrak S150 TX2plus PATA port */ 94 board_2037x_pata = 1, /* FastTrak S150 TX2plus PATA port */
@@ -695,19 +697,20 @@ static void pdc_irq_clear(struct ata_port *ap)
695 readl(mmio + PDC_INT_SEQMASK); 697 readl(mmio + PDC_INT_SEQMASK);
696} 698}
697 699
698static inline int pdc_is_sataii_tx4(unsigned long flags) 700static int pdc_is_sataii_tx4(unsigned long flags)
699{ 701{
700 const unsigned long mask = PDC_FLAG_GEN_II | PDC_FLAG_4_PORTS; 702 const unsigned long mask = PDC_FLAG_GEN_II | PDC_FLAG_4_PORTS;
701 return (flags & mask) == mask; 703 return (flags & mask) == mask;
702} 704}
703 705
704static inline unsigned int pdc_port_no_to_ata_no(unsigned int port_no, int is_sataii_tx4) 706static unsigned int pdc_port_no_to_ata_no(unsigned int port_no,
707 int is_sataii_tx4)
705{ 708{
706 static const unsigned char sataii_tx4_port_remap[4] = { 3, 1, 0, 2}; 709 static const unsigned char sataii_tx4_port_remap[4] = { 3, 1, 0, 2};
707 return is_sataii_tx4 ? sataii_tx4_port_remap[port_no] : port_no; 710 return is_sataii_tx4 ? sataii_tx4_port_remap[port_no] : port_no;
708} 711}
709 712
710static irqreturn_t pdc_interrupt (int irq, void *dev_instance) 713static irqreturn_t pdc_interrupt(int irq, void *dev_instance)
711{ 714{
712 struct ata_host *host = dev_instance; 715 struct ata_host *host = dev_instance;
713 struct ata_port *ap; 716 struct ata_port *ap;
@@ -839,15 +842,16 @@ static unsigned int pdc_qc_issue_prot(struct ata_queued_cmd *qc)
839 842
840static void pdc_tf_load_mmio(struct ata_port *ap, const struct ata_taskfile *tf) 843static void pdc_tf_load_mmio(struct ata_port *ap, const struct ata_taskfile *tf)
841{ 844{
842 WARN_ON (tf->protocol == ATA_PROT_DMA || 845 WARN_ON(tf->protocol == ATA_PROT_DMA ||
843 tf->protocol == ATA_PROT_ATAPI_DMA); 846 tf->protocol == ATA_PROT_ATAPI_DMA);
844 ata_tf_load(ap, tf); 847 ata_tf_load(ap, tf);
845} 848}
846 849
847static void pdc_exec_command_mmio(struct ata_port *ap, const struct ata_taskfile *tf) 850static void pdc_exec_command_mmio(struct ata_port *ap,
851 const struct ata_taskfile *tf)
848{ 852{
849 WARN_ON (tf->protocol == ATA_PROT_DMA || 853 WARN_ON(tf->protocol == ATA_PROT_DMA ||
850 tf->protocol == ATA_PROT_ATAPI_DMA); 854 tf->protocol == ATA_PROT_ATAPI_DMA);
851 ata_exec_command(ap, tf); 855 ata_exec_command(ap, tf);
852} 856}
853 857
@@ -870,8 +874,11 @@ static int pdc_check_atapi_dma(struct ata_queued_cmd *qc)
870 } 874 }
871 /* -45150 (FFFF4FA2) to -1 (FFFFFFFF) shall use PIO mode */ 875 /* -45150 (FFFF4FA2) to -1 (FFFFFFFF) shall use PIO mode */
872 if (scsicmd[0] == WRITE_10) { 876 if (scsicmd[0] == WRITE_10) {
873 unsigned int lba; 877 unsigned int lba =
874 lba = (scsicmd[2] << 24) | (scsicmd[3] << 16) | (scsicmd[4] << 8) | scsicmd[5]; 878 (scsicmd[2] << 24) |
879 (scsicmd[3] << 16) |
880 (scsicmd[4] << 8) |
881 scsicmd[5];
875 if (lba >= 0xFFFF4FA2) 882 if (lba >= 0xFFFF4FA2)
876 pio = 1; 883 pio = 1;
877 } 884 }
@@ -956,7 +963,8 @@ static void pdc_host_init(struct ata_host *host)
956 writel(tmp, mmio + PDC_SLEW_CTL); 963 writel(tmp, mmio + PDC_SLEW_CTL);
957} 964}
958 965
959static int pdc_ata_init_one (struct pci_dev *pdev, const struct pci_device_id *ent) 966static int pdc_ata_init_one(struct pci_dev *pdev,
967 const struct pci_device_id *ent)
960{ 968{
961 static int printed_version; 969 static int printed_version;
962 const struct ata_port_info *pi = &pdc_port_info[ent->driver_data]; 970 const struct ata_port_info *pi = &pdc_port_info[ent->driver_data];