public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
From: Namhyung Kim <namhyung@gmail.com>
To: "James E.J. Bottomley" <JBottomley@parallels.com>
Cc: linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH 2/3] [SCSI] sd: remove dead code
Date: Tue,  2 Aug 2011 12:50:52 +0900	[thread overview]
Message-ID: <1312257053-2522-2-git-send-email-namhyung@gmail.com> (raw)
In-Reply-To: <1312257053-2522-1-git-send-email-namhyung@gmail.com>

As rq_data_dir() only checks a single bit (REQ_WRITE), the result
can not be anything but READ or WRITE. Thus last ELSE clause is
not needed at all.

Signed-off-by: Namhyung Kim <namhyung@gmail.com>
---
 drivers/scsi/sd.c |    5 +----
 1 files changed, 1 insertions(+), 4 deletions(-)

diff --git a/drivers/scsi/sd.c b/drivers/scsi/sd.c
index 463a324835f4..fbb522add124 100644
--- a/drivers/scsi/sd.c
+++ b/drivers/scsi/sd.c
@@ -760,12 +760,9 @@ static int sd_prep_fn(struct request_queue *q, struct request *rq)
 		    sd_dif_prepare(rq, block, sdp->sector_size) == -EIO)
 			goto out;
 
-	} else if (rq_data_dir(rq) == READ) {
+	} else { /* READ */
 		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,
-- 
1.7.6


  reply	other threads:[~2011-08-02  3:53 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-08-02  3:50 [PATCH 1/3] [SCSI] sd: consolidate sector size alignment check in sd_pref_fn Namhyung Kim
2011-08-02  3:50 ` Namhyung Kim [this message]
2011-08-02 16:29   ` [PATCH 2/3] [SCSI] sd: remove dead code James Bottomley
2011-08-02  3:50 ` [PATCH 3/3] [SCSI] sd: update kernel doc comments Namhyung Kim
2011-08-02 16:29 ` [PATCH 1/3] [SCSI] sd: consolidate sector size alignment check in sd_pref_fn James Bottomley
2011-08-03  1:03   ` [PATCH v2] [SCSI] sd: consolidate sector size alignment check in sd_prep_fn Namhyung Kim

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=1312257053-2522-2-git-send-email-namhyung@gmail.com \
    --to=namhyung@gmail.com \
    --cc=JBottomley@parallels.com \
    --cc=linux-kernel@vger.kernel.org \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox