From 1e6f2416044c062a56091ebf8d76760956dd5872 Mon Sep 17 00:00:00 2001 From: Christoph Hellwig Date: Thu, 13 Nov 2014 14:27:41 +0100 Subject: 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 Reviewed-by: Mike Christie Reviewed-by: Hannes Reinecke --- drivers/scsi/3w-sas.c | 2 -- 1 file changed, 2 deletions(-) (limited to 'drivers/scsi/3w-sas.c') 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, if (reason != SCSI_QDEPTH_DEFAULT) return -EOPNOTSUPP; - if (queue_depth > TW_Q_LENGTH-2) - queue_depth = TW_Q_LENGTH-2; scsi_adjust_queue_depth(sdev, queue_depth); return queue_depth; } /* End twl_change_queue_depth() */ -- cgit