[PATCH] libata: move err_mask to ata_queued_cmd
- remove err_mask from the parameter list of the complete functions - move err_mask to ata_queued_cmd - initialize qc->err_mask when needed - for each function call to ata_qc_complete(), replace the err_mask parameter with qc->err_mask. Signed-off-by: Albert Lee <albertcc@tw.ibm.com> =============== Signed-off-by: Jeff Garzik <jgarzik@pobox.com>
This commit is contained in:
@ -194,7 +194,7 @@ struct ata_port;
|
||||
struct ata_queued_cmd;
|
||||
|
||||
/* typedefs */
|
||||
typedef int (*ata_qc_cb_t) (struct ata_queued_cmd *qc, unsigned int err_mask);
|
||||
typedef int (*ata_qc_cb_t) (struct ata_queued_cmd *qc);
|
||||
|
||||
struct ata_ioports {
|
||||
unsigned long cmd_addr;
|
||||
@ -279,6 +279,8 @@ struct ata_queued_cmd {
|
||||
/* DO NOT iterate over __sg manually, use ata_for_each_sg() */
|
||||
struct scatterlist *__sg;
|
||||
|
||||
unsigned int err_mask;
|
||||
|
||||
ata_qc_cb_t complete_fn;
|
||||
|
||||
struct completion *waiting;
|
||||
@ -475,7 +477,7 @@ extern void ata_bmdma_start (struct ata_queued_cmd *qc);
|
||||
extern void ata_bmdma_stop(struct ata_queued_cmd *qc);
|
||||
extern u8 ata_bmdma_status(struct ata_port *ap);
|
||||
extern void ata_bmdma_irq_clear(struct ata_port *ap);
|
||||
extern void ata_qc_complete(struct ata_queued_cmd *qc, unsigned int err_mask);
|
||||
extern void ata_qc_complete(struct ata_queued_cmd *qc);
|
||||
extern void ata_eng_timeout(struct ata_port *ap);
|
||||
extern void ata_scsi_simulate(u16 *id, struct scsi_cmnd *cmd,
|
||||
void (*done)(struct scsi_cmnd *));
|
||||
@ -667,6 +669,7 @@ static inline void ata_qc_reinit(struct ata_queued_cmd *qc)
|
||||
qc->cursect = qc->cursg = qc->cursg_ofs = 0;
|
||||
qc->nsect = 0;
|
||||
qc->nbytes = qc->curbytes = 0;
|
||||
qc->err_mask = 0;
|
||||
|
||||
ata_tf_init(qc->ap, &qc->tf, qc->dev->devno);
|
||||
}
|
||||
|
Reference in New Issue
Block a user