lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1312257053-2522-2-git-send-email-namhyung@gmail.com>
Date:	Tue,  2 Aug 2011 12:50:52 +0900
From:	Namhyung Kim <namhyung@...il.com>
To:	"James E.J. Bottomley" <JBottomley@...allels.com>
Cc:	linux-scsi@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: [PATCH 2/3] [SCSI] sd: remove dead code

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@...il.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

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ