diff options
author | Boaz Harrosh <bharrosh@panasas.com> | 2007-06-20 07:53:23 -0400 |
---|---|---|
committer | Jens Axboe <jens.axboe@oracle.com> | 2007-07-10 02:03:34 -0400 |
commit | e654bc4393e85e326993256d80b9710a4d6411ff (patch) | |
tree | bf30413fd62f778e4c9abd8bc92e7a399ac37e53 /drivers/cdrom | |
parent | 9cff3b383dad193b0762c27278a16237e10b53dc (diff) |
[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>
Diffstat (limited to 'drivers/cdrom')
-rw-r--r-- | drivers/cdrom/aztcd.c | 2 | ||||
-rw-r--r-- | drivers/cdrom/cm206.c | 2 | ||||
-rw-r--r-- | drivers/cdrom/gscd.c | 2 | ||||
-rw-r--r-- | drivers/cdrom/mcdx.c | 2 | ||||
-rw-r--r-- | drivers/cdrom/optcd.c | 2 | ||||
-rw-r--r-- | drivers/cdrom/sjcd.c | 2 |
6 files changed, 6 insertions, 6 deletions
diff --git a/drivers/cdrom/aztcd.c b/drivers/cdrom/aztcd.c index 1f9fb7a96703..d7fbfaae2449 100644 --- a/drivers/cdrom/aztcd.c +++ b/drivers/cdrom/aztcd.c | |||
@@ -229,7 +229,7 @@ static struct request_queue *azt_queue; | |||
229 | static int current_valid(void) | 229 | static int current_valid(void) |
230 | { | 230 | { |
231 | return CURRENT && | 231 | return CURRENT && |
232 | CURRENT->cmd == READ && | 232 | rq_data_dir(CURRENT) == READ && |
233 | CURRENT->sector != -1; | 233 | CURRENT->sector != -1; |
234 | } | 234 | } |
235 | 235 | ||
diff --git a/drivers/cdrom/cm206.c b/drivers/cdrom/cm206.c index 230131163240..2f8fe3b6bbd0 100644 --- a/drivers/cdrom/cm206.c +++ b/drivers/cdrom/cm206.c | |||
@@ -851,7 +851,7 @@ static void do_cm206_request(request_queue_t * q) | |||
851 | if (!req) | 851 | if (!req) |
852 | return; | 852 | return; |
853 | 853 | ||
854 | if (req->cmd != READ) { | 854 | if (rq_data_dir(req) != READ) { |
855 | debug(("Non-read command %d on cdrom\n", req->cmd)); | 855 | debug(("Non-read command %d on cdrom\n", req->cmd)); |
856 | end_request(req, 0); | 856 | end_request(req, 0); |
857 | continue; | 857 | continue; |
diff --git a/drivers/cdrom/gscd.c b/drivers/cdrom/gscd.c index b3ab6e9b8df1..176742ed007b 100644 --- a/drivers/cdrom/gscd.c +++ b/drivers/cdrom/gscd.c | |||
@@ -264,7 +264,7 @@ repeat: | |||
264 | if (req->sector == -1) | 264 | if (req->sector == -1) |
265 | goto out; | 265 | goto out; |
266 | 266 | ||
267 | if (req->cmd != READ) { | 267 | if (rq_data_dir(req) != READ) { |
268 | printk("GSCD: bad cmd %u\n", rq_data_dir(req)); | 268 | printk("GSCD: bad cmd %u\n", rq_data_dir(req)); |
269 | end_request(req, 0); | 269 | end_request(req, 0); |
270 | goto repeat; | 270 | goto repeat; |
diff --git a/drivers/cdrom/mcdx.c b/drivers/cdrom/mcdx.c index 4310cc84dfed..972ee9c8247c 100644 --- a/drivers/cdrom/mcdx.c +++ b/drivers/cdrom/mcdx.c | |||
@@ -596,7 +596,7 @@ static void do_mcdx_request(request_queue_t * q) | |||
596 | xtrace(REQUEST, "do_request() (%lu + %lu)\n", | 596 | xtrace(REQUEST, "do_request() (%lu + %lu)\n", |
597 | req->sector, req->nr_sectors); | 597 | req->sector, req->nr_sectors); |
598 | 598 | ||
599 | if (req->cmd != READ) { | 599 | if (rq_data_dir(req) != READ) { |
600 | xwarn("do_request(): non-read command to cd!!\n"); | 600 | xwarn("do_request(): non-read command to cd!!\n"); |
601 | xtrace(REQUEST, "end_request(0): write\n"); | 601 | xtrace(REQUEST, "end_request(0): write\n"); |
602 | end_request(req, 0); | 602 | end_request(req, 0); |
diff --git a/drivers/cdrom/optcd.c b/drivers/cdrom/optcd.c index 3541690a77d4..efd619c0fe10 100644 --- a/drivers/cdrom/optcd.c +++ b/drivers/cdrom/optcd.c | |||
@@ -977,7 +977,7 @@ static int update_toc(void) | |||
977 | static int current_valid(void) | 977 | static int current_valid(void) |
978 | { | 978 | { |
979 | return CURRENT && | 979 | return CURRENT && |
980 | CURRENT->cmd == READ && | 980 | rq_data_dir(CURRENT) == READ && |
981 | CURRENT->sector != -1; | 981 | CURRENT->sector != -1; |
982 | } | 982 | } |
983 | 983 | ||
diff --git a/drivers/cdrom/sjcd.c b/drivers/cdrom/sjcd.c index 5409fca5bbfc..76c24e679e68 100644 --- a/drivers/cdrom/sjcd.c +++ b/drivers/cdrom/sjcd.c | |||
@@ -1064,7 +1064,7 @@ static void sjcd_invalidate_buffers(void) | |||
1064 | static int current_valid(void) | 1064 | static int current_valid(void) |
1065 | { | 1065 | { |
1066 | return CURRENT && | 1066 | return CURRENT && |
1067 | CURRENT->cmd == READ && | 1067 | rq_data_dir(CURRENT) == READ && |
1068 | CURRENT->sector != -1; | 1068 | CURRENT->sector != -1; |
1069 | } | 1069 | } |
1070 | 1070 | ||