From: Boaz Harrosh <bharrosh@panasas.com>
To: James Bottomley <James.Bottomley@SteelEye.com>,
linux-scsi <linux-scsi@vger.kernel.org>
Subject: [PATCH] sr/sd: Remove simple dead code
Date: Thu, 13 Dec 2007 13:34:05 +0200 [thread overview]
Message-ID: <476118AD.80407@panasas.com> (raw)
if (rq_data_dir() == WRITE) else if() else chain had an extra
"else" since the if() is on a value of 1 bit.
Also with a bidi request rq_data_dir() == WRITE
and blk_bidi_rq() == true.
Signed-off-by: Boaz Harrosh <bharrosh@panasas.com>
---
drivers/scsi/sd.c | 5 +----
drivers/scsi/sr.c | 5 +----
2 files changed, 2 insertions(+), 8 deletions(-)
diff --git a/drivers/scsi/sd.c b/drivers/scsi/sd.c
index 212f6bc..e6d85b0 100644
--- a/drivers/scsi/sd.c
+++ b/drivers/scsi/sd.c
@@ -445,12 +445,9 @@ static int sd_prep_fn(struct request_queue *q, struct request *rq)
}
SCpnt->cmnd[0] = WRITE_6;
SCpnt->sc_data_direction = DMA_TO_DEVICE;
- } else if (rq_data_dir(rq) == READ) {
+ } else {
SCpnt->cmnd[0] = READ_6;
SCpnt->sc_data_direction = DMA_FROM_DEVICE;
- } else {
- scmd_printk(KERN_ERR, SCpnt, "Unknown command %x\n", rq->cmd_flags);
- goto out;
}
SCSI_LOG_HLQUEUE(2, scmd_printk(KERN_INFO, SCpnt,
diff --git a/drivers/scsi/sr.c b/drivers/scsi/sr.c
index 896be4a..7128d15 100644
--- a/drivers/scsi/sr.c
+++ b/drivers/scsi/sr.c
@@ -372,12 +372,9 @@ static int sr_prep_fn(struct request_queue *q, struct request *rq)
SCpnt->cmnd[0] = WRITE_10;
SCpnt->sc_data_direction = DMA_TO_DEVICE;
cd->cdi.media_written = 1;
- } else if (rq_data_dir(rq) == READ) {
+ } else {
SCpnt->cmnd[0] = READ_10;
SCpnt->sc_data_direction = DMA_FROM_DEVICE;
- } else {
- blk_dump_rq_flags(rq, "Unknown sr command");
- goto out;
}
{
--
1.5.3.3
reply other threads:[~2007-12-13 11:34 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=476118AD.80407@panasas.com \
--to=bharrosh@panasas.com \
--cc=James.Bottomley@SteelEye.com \
--cc=linux-scsi@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.