mg_disk: fix enum REQ_OP_ kbuild error
Because we define WRITE/READ as REQ_OPs, we cannot do switch (rq_data_dir(request)) case READ .... case WRITE ... without getting warnings about handling other REQ_OPs. This just has mq_disk do a if/else like it does in other places. Signed-off-by: Mike Christie <mchristi@redhat.com> Signed-off-by: Jens Axboe <axboe@fb.com>
This commit is contained in:
parent
47b0e50ac7
commit
56332f02a5
|
@ -687,15 +687,13 @@ static unsigned int mg_issue_req(struct request *req,
|
||||||
unsigned int sect_num,
|
unsigned int sect_num,
|
||||||
unsigned int sect_cnt)
|
unsigned int sect_cnt)
|
||||||
{
|
{
|
||||||
switch (rq_data_dir(req)) {
|
if (rq_data_dir(req) == READ) {
|
||||||
case READ:
|
|
||||||
if (mg_out(host, sect_num, sect_cnt, MG_CMD_RD, &mg_read_intr)
|
if (mg_out(host, sect_num, sect_cnt, MG_CMD_RD, &mg_read_intr)
|
||||||
!= MG_ERR_NONE) {
|
!= MG_ERR_NONE) {
|
||||||
mg_bad_rw_intr(host);
|
mg_bad_rw_intr(host);
|
||||||
return host->error;
|
return host->error;
|
||||||
}
|
}
|
||||||
break;
|
} else {
|
||||||
case WRITE:
|
|
||||||
/* TODO : handler */
|
/* TODO : handler */
|
||||||
outb(ATA_NIEN, (unsigned long)host->dev_base + MG_REG_DRV_CTRL);
|
outb(ATA_NIEN, (unsigned long)host->dev_base + MG_REG_DRV_CTRL);
|
||||||
if (mg_out(host, sect_num, sect_cnt, MG_CMD_WR, &mg_write_intr)
|
if (mg_out(host, sect_num, sect_cnt, MG_CMD_WR, &mg_write_intr)
|
||||||
|
@ -714,7 +712,6 @@ static unsigned int mg_issue_req(struct request *req,
|
||||||
mod_timer(&host->timer, jiffies + 3 * HZ);
|
mod_timer(&host->timer, jiffies + 3 * HZ);
|
||||||
outb(MG_CMD_WR_CONF, (unsigned long)host->dev_base +
|
outb(MG_CMD_WR_CONF, (unsigned long)host->dev_base +
|
||||||
MG_REG_COMMAND);
|
MG_REG_COMMAND);
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
return MG_ERR_NONE;
|
return MG_ERR_NONE;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue