summaryrefslogtreecommitdiffstats
path: root/drivers/scsi/3w-sas.c
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2014-11-13 08:27:41 -0500
committerChristoph Hellwig <hch@lst.de>2014-11-24 08:45:26 -0500
commit1e6f2416044c062a56091ebf8d76760956dd5872 (patch)
tree53b83ab97cc475c37f957bb85167ae8cb2ccd550 /drivers/scsi/3w-sas.c
parentc40ecc12cfdb630332198a04e2832ae8218a61f1 (diff)
scsi: don't allow setting of queue_depth bigger than can_queue
We won't ever queue more commands than the host allows. Instead of letting drivers either reject or ignore this case handle it in common code. Note that various driver use internal constant or variables that are assigned to both shost->can_queue and checked in ->change_queue_depth - I did remove those checks as well. Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Mike Christie <michaelc@cs.wisc.edu> Reviewed-by: Hannes Reinecke <hare@suse.de>
Diffstat (limited to 'drivers/scsi/3w-sas.c')
-rw-r--r--drivers/scsi/3w-sas.c2
1 files changed, 0 insertions, 2 deletions
diff --git a/drivers/scsi/3w-sas.c b/drivers/scsi/3w-sas.c
index ac0c2544a470..547756b7d5bf 100644
--- a/drivers/scsi/3w-sas.c
+++ b/drivers/scsi/3w-sas.c
@@ -198,8 +198,6 @@ static int twl_change_queue_depth(struct scsi_device *sdev, int queue_depth,
198 if (reason != SCSI_QDEPTH_DEFAULT) 198 if (reason != SCSI_QDEPTH_DEFAULT)
199 return -EOPNOTSUPP; 199 return -EOPNOTSUPP;
200 200
201 if (queue_depth > TW_Q_LENGTH-2)
202 queue_depth = TW_Q_LENGTH-2;
203 scsi_adjust_queue_depth(sdev, queue_depth); 201 scsi_adjust_queue_depth(sdev, queue_depth);
204 return queue_depth; 202 return queue_depth;
205} /* End twl_change_queue_depth() */ 203} /* End twl_change_queue_depth() */