[PATCH] fix request->cmd == INT cases
- I have unearthed very old bugs in stale drivers that still used request->cmd as a READ|WRITE int - This patch is maybe a proof that these drivers have not been used for a long time. Should they be removed completely? Drivers that currently do not work for sure: drivers/acorn/block/fd1772.c | 2 +- drivers/acorn/block/mfmhd.c | 8 ++++---- drivers/cdrom/aztcd.c | 2 +- drivers/cdrom/cm206.c | 2 +- drivers/cdrom/gscd.c | 2 +- drivers/cdrom/mcdx.c | 2 +- drivers/cdrom/optcd.c | 2 +- drivers/cdrom/sjcd.c | 2 +- Drivers with cosmetic fixes only: b/drivers/block/amiflop.c b/drivers/block/nbd.c b/drivers/ide/legacy/hd.c Signed-off-by: Boaz Harrosh <bharrosh@panasas.com> Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
This commit is contained in:
@@ -229,7 +229,7 @@ static struct request_queue *azt_queue;
|
||||
static int current_valid(void)
|
||||
{
|
||||
return CURRENT &&
|
||||
CURRENT->cmd == READ &&
|
||||
rq_data_dir(CURRENT) == READ &&
|
||||
CURRENT->sector != -1;
|
||||
}
|
||||
|
||||
|
@@ -851,7 +851,7 @@ static void do_cm206_request(request_queue_t * q)
|
||||
if (!req)
|
||||
return;
|
||||
|
||||
if (req->cmd != READ) {
|
||||
if (rq_data_dir(req) != READ) {
|
||||
debug(("Non-read command %d on cdrom\n", req->cmd));
|
||||
end_request(req, 0);
|
||||
continue;
|
||||
|
@@ -264,7 +264,7 @@ repeat:
|
||||
if (req->sector == -1)
|
||||
goto out;
|
||||
|
||||
if (req->cmd != READ) {
|
||||
if (rq_data_dir(req) != READ) {
|
||||
printk("GSCD: bad cmd %u\n", rq_data_dir(req));
|
||||
end_request(req, 0);
|
||||
goto repeat;
|
||||
|
@@ -596,7 +596,7 @@ static void do_mcdx_request(request_queue_t * q)
|
||||
xtrace(REQUEST, "do_request() (%lu + %lu)\n",
|
||||
req->sector, req->nr_sectors);
|
||||
|
||||
if (req->cmd != READ) {
|
||||
if (rq_data_dir(req) != READ) {
|
||||
xwarn("do_request(): non-read command to cd!!\n");
|
||||
xtrace(REQUEST, "end_request(0): write\n");
|
||||
end_request(req, 0);
|
||||
|
@@ -977,7 +977,7 @@ static int update_toc(void)
|
||||
static int current_valid(void)
|
||||
{
|
||||
return CURRENT &&
|
||||
CURRENT->cmd == READ &&
|
||||
rq_data_dir(CURRENT) == READ &&
|
||||
CURRENT->sector != -1;
|
||||
}
|
||||
|
||||
|
@@ -1064,7 +1064,7 @@ static void sjcd_invalidate_buffers(void)
|
||||
static int current_valid(void)
|
||||
{
|
||||
return CURRENT &&
|
||||
CURRENT->cmd == READ &&
|
||||
rq_data_dir(CURRENT) == READ &&
|
||||
CURRENT->sector != -1;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user