[SCSI] fnic: remove redundant BUG_ONs and fix checks on unsigned

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: <git-commits-head@...>
Date: Friday, July 3, 2009 - 5:59 pm

Gitweb:     http://git.kernel.org/linus/87a2d34b0372dcf6bc4caf4d97a7889f5e62a1af
Commit:     87a2d34b0372dcf6bc4caf4d97a7889f5e62a1af
Parent:     e08afeb7e69f45e4ab9fbb8530fe433484b96606
Author:     Roel Kluin <roel.kluin@gmail.com>
AuthorDate: Tue Jun 23 01:06:40 2009 +0200
Committer:  James Bottomley <James.Bottomley@HansenPartnership.com>
CommitDate: Thu Jun 25 11:08:23 2009 -0500

    [SCSI] fnic: remove redundant BUG_ONs and fix checks on unsigned
    
    The shost sg tablesize is set to FNIC_MAX_SG_DESC_CNT and fnic uses
    scsi_dma_map, so both BUG_ONs can be removed.
    
    scsi_dma_map may return -ENOMEM, sg_count should be int to catch that.
    
    Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
    Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
---
 drivers/scsi/fnic/fnic_scsi.c |    7 ++-----
 1 files changed, 2 insertions(+), 5 deletions(-)

diff --git a/drivers/scsi/fnic/fnic_scsi.c b/drivers/scsi/fnic/fnic_scsi.c
index eabf365..bfc9969 100644
--- a/drivers/scsi/fnic/fnic_scsi.c
+++ b/drivers/scsi/fnic/fnic_scsi.c
@@ -245,7 +245,7 @@ static inline int fnic_queue_wq_copy_desc(struct fnic *fnic,
 					  struct vnic_wq_copy *wq,
 					  struct fnic_io_req *io_req,
 					  struct scsi_cmnd *sc,
-					  u32 sg_count)
+					  int sg_count)
 {
 	struct scatterlist *sg;
 	struct fc_rport *rport = starget_to_rport(scsi_target(sc->device));
@@ -260,9 +260,6 @@ static inline int fnic_queue_wq_copy_desc(struct fnic *fnic,
 	char msg[2];
 
 	if (sg_count) {
-		BUG_ON(sg_count < 0);
-		BUG_ON(sg_count > FNIC_MAX_SG_DESC_CNT);
-
 		/* For each SGE, create a device desc entry */
 		desc = io_req->sgl_list;
 		for_each_sg(scsi_sglist(sc), sg, sg_count, i) {
@@ -344,7 +341,7 @@ int fnic_queuecommand(struct scsi_cmnd *sc, void (*done)(struct scsi_cmnd *))
 	struct fnic *fnic;
 	struct vnic_wq_copy *wq;
 	int ret;
-	u32 sg_count;
+	int sg_count;
 	unsigned long flags;
 	unsigned long ptr;
 
--
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[SCSI] fnic: remove redundant BUG_ONs and fix checks on unsi..., Linux Kernel Mailing List..., (Fri Jul 3, 5:59 pm)