Commit 931139af authored by Damien Le Moal's avatar Damien Le Moal

ata: libata: simplify qc_fill_rtf port operation interface

The boolean return value of the qc_fill_rtf operation is used nowhere.
Simplify this operation interface by making it a void function. All
drivers defining this operation are also updated.
Signed-off-by: default avatarDamien Le Moal <damien.lemoal@opensource.wdc.com>
Signed-off-by: default avatarNiklas Cassel <niklas.cassel@wdc.com>
Reviewed-by: default avatarJohn Garry <john.g.garry@oracle.com>
parent 87629312
...@@ -57,7 +57,7 @@ struct acard_sg { ...@@ -57,7 +57,7 @@ struct acard_sg {
}; };
static enum ata_completion_errors acard_ahci_qc_prep(struct ata_queued_cmd *qc); static enum ata_completion_errors acard_ahci_qc_prep(struct ata_queued_cmd *qc);
static bool acard_ahci_qc_fill_rtf(struct ata_queued_cmd *qc); static void acard_ahci_qc_fill_rtf(struct ata_queued_cmd *qc);
static int acard_ahci_port_start(struct ata_port *ap); static int acard_ahci_port_start(struct ata_port *ap);
static int acard_ahci_init_one(struct pci_dev *pdev, const struct pci_device_id *ent); static int acard_ahci_init_one(struct pci_dev *pdev, const struct pci_device_id *ent);
...@@ -248,7 +248,7 @@ static enum ata_completion_errors acard_ahci_qc_prep(struct ata_queued_cmd *qc) ...@@ -248,7 +248,7 @@ static enum ata_completion_errors acard_ahci_qc_prep(struct ata_queued_cmd *qc)
return AC_ERR_OK; return AC_ERR_OK;
} }
static bool acard_ahci_qc_fill_rtf(struct ata_queued_cmd *qc) static void acard_ahci_qc_fill_rtf(struct ata_queued_cmd *qc)
{ {
struct ahci_port_priv *pp = qc->ap->private_data; struct ahci_port_priv *pp = qc->ap->private_data;
u8 *rx_fis = pp->rx_fis; u8 *rx_fis = pp->rx_fis;
...@@ -268,8 +268,6 @@ static bool acard_ahci_qc_fill_rtf(struct ata_queued_cmd *qc) ...@@ -268,8 +268,6 @@ static bool acard_ahci_qc_fill_rtf(struct ata_queued_cmd *qc)
qc->result_tf.status = (rx_fis + RX_FIS_PIO_SETUP)[15]; qc->result_tf.status = (rx_fis + RX_FIS_PIO_SETUP)[15];
} else } else
ata_tf_from_fis(rx_fis + RX_FIS_D2H_REG, &qc->result_tf); ata_tf_from_fis(rx_fis + RX_FIS_D2H_REG, &qc->result_tf);
return true;
} }
static int acard_ahci_port_start(struct ata_port *ap) static int acard_ahci_port_start(struct ata_port *ap)
......
...@@ -55,7 +55,7 @@ static ssize_t ahci_transmit_led_message(struct ata_port *ap, u32 state, ...@@ -55,7 +55,7 @@ static ssize_t ahci_transmit_led_message(struct ata_port *ap, u32 state,
static int ahci_scr_read(struct ata_link *link, unsigned int sc_reg, u32 *val); static int ahci_scr_read(struct ata_link *link, unsigned int sc_reg, u32 *val);
static int ahci_scr_write(struct ata_link *link, unsigned int sc_reg, u32 val); static int ahci_scr_write(struct ata_link *link, unsigned int sc_reg, u32 val);
static bool ahci_qc_fill_rtf(struct ata_queued_cmd *qc); static void ahci_qc_fill_rtf(struct ata_queued_cmd *qc);
static int ahci_port_start(struct ata_port *ap); static int ahci_port_start(struct ata_port *ap);
static void ahci_port_stop(struct ata_port *ap); static void ahci_port_stop(struct ata_port *ap);
static enum ata_completion_errors ahci_qc_prep(struct ata_queued_cmd *qc); static enum ata_completion_errors ahci_qc_prep(struct ata_queued_cmd *qc);
...@@ -2053,7 +2053,7 @@ unsigned int ahci_qc_issue(struct ata_queued_cmd *qc) ...@@ -2053,7 +2053,7 @@ unsigned int ahci_qc_issue(struct ata_queued_cmd *qc)
} }
EXPORT_SYMBOL_GPL(ahci_qc_issue); EXPORT_SYMBOL_GPL(ahci_qc_issue);
static bool ahci_qc_fill_rtf(struct ata_queued_cmd *qc) static void ahci_qc_fill_rtf(struct ata_queued_cmd *qc)
{ {
struct ahci_port_priv *pp = qc->ap->private_data; struct ahci_port_priv *pp = qc->ap->private_data;
u8 *rx_fis = pp->rx_fis; u8 *rx_fis = pp->rx_fis;
...@@ -2087,8 +2087,6 @@ static bool ahci_qc_fill_rtf(struct ata_queued_cmd *qc) ...@@ -2087,8 +2087,6 @@ static bool ahci_qc_fill_rtf(struct ata_queued_cmd *qc)
qc->result_tf.error = fis[3]; qc->result_tf.error = fis[3];
} else } else
ata_tf_from_fis(rx_fis + RX_FIS_D2H_REG, &qc->result_tf); ata_tf_from_fis(rx_fis + RX_FIS_D2H_REG, &qc->result_tf);
return true;
} }
static void ahci_freeze(struct ata_port *ap) static void ahci_freeze(struct ata_port *ap)
......
...@@ -1377,14 +1377,10 @@ EXPORT_SYMBOL_GPL(ata_sff_qc_issue); ...@@ -1377,14 +1377,10 @@ EXPORT_SYMBOL_GPL(ata_sff_qc_issue);
* *
* LOCKING: * LOCKING:
* spin_lock_irqsave(host lock) * spin_lock_irqsave(host lock)
*
* RETURNS:
* true indicating that result TF is successfully filled.
*/ */
bool ata_sff_qc_fill_rtf(struct ata_queued_cmd *qc) void ata_sff_qc_fill_rtf(struct ata_queued_cmd *qc)
{ {
qc->ap->ops->sff_tf_read(qc->ap, &qc->result_tf); qc->ap->ops->sff_tf_read(qc->ap, &qc->result_tf);
return true;
} }
EXPORT_SYMBOL_GPL(ata_sff_qc_fill_rtf); EXPORT_SYMBOL_GPL(ata_sff_qc_fill_rtf);
......
...@@ -566,7 +566,7 @@ static unsigned int sata_fsl_qc_issue(struct ata_queued_cmd *qc) ...@@ -566,7 +566,7 @@ static unsigned int sata_fsl_qc_issue(struct ata_queued_cmd *qc)
return 0; return 0;
} }
static bool sata_fsl_qc_fill_rtf(struct ata_queued_cmd *qc) static void sata_fsl_qc_fill_rtf(struct ata_queued_cmd *qc)
{ {
struct sata_fsl_port_priv *pp = qc->ap->private_data; struct sata_fsl_port_priv *pp = qc->ap->private_data;
struct sata_fsl_host_priv *host_priv = qc->ap->host->private_data; struct sata_fsl_host_priv *host_priv = qc->ap->host->private_data;
...@@ -577,7 +577,6 @@ static bool sata_fsl_qc_fill_rtf(struct ata_queued_cmd *qc) ...@@ -577,7 +577,6 @@ static bool sata_fsl_qc_fill_rtf(struct ata_queued_cmd *qc)
cd = pp->cmdentry + tag; cd = pp->cmdentry + tag;
ata_tf_from_fis(cd->sfis, &qc->result_tf); ata_tf_from_fis(cd->sfis, &qc->result_tf);
return true;
} }
static int sata_fsl_scr_write(struct ata_link *link, static int sata_fsl_scr_write(struct ata_link *link,
......
...@@ -566,7 +566,7 @@ static void inic_tf_read(struct ata_port *ap, struct ata_taskfile *tf) ...@@ -566,7 +566,7 @@ static void inic_tf_read(struct ata_port *ap, struct ata_taskfile *tf)
tf->status = readb(port_base + PORT_TF_COMMAND); tf->status = readb(port_base + PORT_TF_COMMAND);
} }
static bool inic_qc_fill_rtf(struct ata_queued_cmd *qc) static void inic_qc_fill_rtf(struct ata_queued_cmd *qc)
{ {
struct ata_taskfile *rtf = &qc->result_tf; struct ata_taskfile *rtf = &qc->result_tf;
struct ata_taskfile tf; struct ata_taskfile tf;
...@@ -580,12 +580,10 @@ static bool inic_qc_fill_rtf(struct ata_queued_cmd *qc) ...@@ -580,12 +580,10 @@ static bool inic_qc_fill_rtf(struct ata_queued_cmd *qc)
*/ */
inic_tf_read(qc->ap, &tf); inic_tf_read(qc->ap, &tf);
if (!(tf.status & ATA_ERR)) if (tf.status & ATA_ERR) {
return false;
rtf->status = tf.status; rtf->status = tf.status;
rtf->error = tf.error; rtf->error = tf.error;
return true; }
} }
static void inic_freeze(struct ata_port *ap) static void inic_freeze(struct ata_port *ap)
......
...@@ -328,7 +328,7 @@ static int sil24_scr_write(struct ata_link *link, unsigned sc_reg, u32 val); ...@@ -328,7 +328,7 @@ static int sil24_scr_write(struct ata_link *link, unsigned sc_reg, u32 val);
static int sil24_qc_defer(struct ata_queued_cmd *qc); static int sil24_qc_defer(struct ata_queued_cmd *qc);
static enum ata_completion_errors sil24_qc_prep(struct ata_queued_cmd *qc); static enum ata_completion_errors sil24_qc_prep(struct ata_queued_cmd *qc);
static unsigned int sil24_qc_issue(struct ata_queued_cmd *qc); static unsigned int sil24_qc_issue(struct ata_queued_cmd *qc);
static bool sil24_qc_fill_rtf(struct ata_queued_cmd *qc); static void sil24_qc_fill_rtf(struct ata_queued_cmd *qc);
static void sil24_pmp_attach(struct ata_port *ap); static void sil24_pmp_attach(struct ata_port *ap);
static void sil24_pmp_detach(struct ata_port *ap); static void sil24_pmp_detach(struct ata_port *ap);
static void sil24_freeze(struct ata_port *ap); static void sil24_freeze(struct ata_port *ap);
...@@ -901,10 +901,9 @@ static unsigned int sil24_qc_issue(struct ata_queued_cmd *qc) ...@@ -901,10 +901,9 @@ static unsigned int sil24_qc_issue(struct ata_queued_cmd *qc)
return 0; return 0;
} }
static bool sil24_qc_fill_rtf(struct ata_queued_cmd *qc) static void sil24_qc_fill_rtf(struct ata_queued_cmd *qc)
{ {
sil24_read_tf(qc->ap, qc->hw_tag, &qc->result_tf); sil24_read_tf(qc->ap, qc->hw_tag, &qc->result_tf);
return true;
} }
static void sil24_pmp_attach(struct ata_port *ap) static void sil24_pmp_attach(struct ata_port *ap)
......
...@@ -7142,11 +7142,8 @@ static unsigned int ipr_qc_issue(struct ata_queued_cmd *qc) ...@@ -7142,11 +7142,8 @@ static unsigned int ipr_qc_issue(struct ata_queued_cmd *qc)
/** /**
* ipr_qc_fill_rtf - Read result TF * ipr_qc_fill_rtf - Read result TF
* @qc: ATA queued command * @qc: ATA queued command
*
* Return value:
* true
**/ **/
static bool ipr_qc_fill_rtf(struct ata_queued_cmd *qc) static void ipr_qc_fill_rtf(struct ata_queued_cmd *qc)
{ {
struct ipr_sata_port *sata_port = qc->ap->private_data; struct ipr_sata_port *sata_port = qc->ap->private_data;
struct ipr_ioasa_gata *g = &sata_port->ioasa; struct ipr_ioasa_gata *g = &sata_port->ioasa;
...@@ -7163,8 +7160,6 @@ static bool ipr_qc_fill_rtf(struct ata_queued_cmd *qc) ...@@ -7163,8 +7160,6 @@ static bool ipr_qc_fill_rtf(struct ata_queued_cmd *qc)
tf->hob_lbal = g->hob_lbal; tf->hob_lbal = g->hob_lbal;
tf->hob_lbam = g->hob_lbam; tf->hob_lbam = g->hob_lbam;
tf->hob_lbah = g->hob_lbah; tf->hob_lbah = g->hob_lbah;
return true;
} }
static struct ata_port_operations ipr_sata_ops = { static struct ata_port_operations ipr_sata_ops = {
......
...@@ -226,12 +226,11 @@ static unsigned int sas_ata_qc_issue(struct ata_queued_cmd *qc) ...@@ -226,12 +226,11 @@ static unsigned int sas_ata_qc_issue(struct ata_queued_cmd *qc)
return ret; return ret;
} }
static bool sas_ata_qc_fill_rtf(struct ata_queued_cmd *qc) static void sas_ata_qc_fill_rtf(struct ata_queued_cmd *qc)
{ {
struct domain_device *dev = qc->ap->private_data; struct domain_device *dev = qc->ap->private_data;
ata_tf_from_fis(dev->sata_dev.fis, &qc->result_tf); ata_tf_from_fis(dev->sata_dev.fis, &qc->result_tf);
return true;
} }
static struct sas_internal *dev_to_sas_internal(struct domain_device *dev) static struct sas_internal *dev_to_sas_internal(struct domain_device *dev)
......
...@@ -876,7 +876,7 @@ struct ata_port_operations { ...@@ -876,7 +876,7 @@ struct ata_port_operations {
int (*check_atapi_dma)(struct ata_queued_cmd *qc); int (*check_atapi_dma)(struct ata_queued_cmd *qc);
enum ata_completion_errors (*qc_prep)(struct ata_queued_cmd *qc); enum ata_completion_errors (*qc_prep)(struct ata_queued_cmd *qc);
unsigned int (*qc_issue)(struct ata_queued_cmd *qc); unsigned int (*qc_issue)(struct ata_queued_cmd *qc);
bool (*qc_fill_rtf)(struct ata_queued_cmd *qc); void (*qc_fill_rtf)(struct ata_queued_cmd *qc);
/* /*
* Configuration and exception handling * Configuration and exception handling
...@@ -1936,7 +1936,7 @@ extern void ata_sff_queue_delayed_work(struct delayed_work *dwork, ...@@ -1936,7 +1936,7 @@ extern void ata_sff_queue_delayed_work(struct delayed_work *dwork,
unsigned long delay); unsigned long delay);
extern void ata_sff_queue_pio_task(struct ata_link *link, unsigned long delay); extern void ata_sff_queue_pio_task(struct ata_link *link, unsigned long delay);
extern unsigned int ata_sff_qc_issue(struct ata_queued_cmd *qc); extern unsigned int ata_sff_qc_issue(struct ata_queued_cmd *qc);
extern bool ata_sff_qc_fill_rtf(struct ata_queued_cmd *qc); extern void ata_sff_qc_fill_rtf(struct ata_queued_cmd *qc);
extern unsigned int ata_sff_port_intr(struct ata_port *ap, extern unsigned int ata_sff_port_intr(struct ata_port *ap,
struct ata_queued_cmd *qc); struct ata_queued_cmd *qc);
extern irqreturn_t ata_sff_interrupt(int irq, void *dev_instance); extern irqreturn_t ata_sff_interrupt(int irq, void *dev_instance);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment