scsi: cleanup switch in scsi_adjust_queue_depth

While checking what scsi_adjust_queue_depth() did I thought its switch
statement could be clearer:

   - remove redundant assignment (to sdev->queue_depth)
   - re-order cases (thus removing the fall-through)

Signed-off-by: Douglas Gilbert <dgilbert@interlog.com>
Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com>
Reviewed-by: Robert Elliott <elliott@hp.com>
Tested-by: Robert Elliott <elliott@hp.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
This commit is contained in:
Douglas Gilbert 2014-07-07 18:00:35 +02:00 committed by Christoph Hellwig
parent f1bea55d5a
commit cb23f912a9
1 changed files with 6 additions and 4 deletions

View File

@ -846,6 +846,10 @@ void scsi_adjust_queue_depth(struct scsi_device *sdev, int tagged, int tags)
sdev->queue_depth = tags;
switch (tagged) {
case 0:
sdev->ordered_tags = 0;
sdev->simple_tags = 0;
break;
case MSG_ORDERED_TAG:
sdev->ordered_tags = 1;
sdev->simple_tags = 1;
@ -855,13 +859,11 @@ void scsi_adjust_queue_depth(struct scsi_device *sdev, int tagged, int tags)
sdev->simple_tags = 1;
break;
default:
sdev->ordered_tags = 0;
sdev->simple_tags = 0;
sdev_printk(KERN_WARNING, sdev,
"scsi_adjust_queue_depth, bad queue type, "
"disabled\n");
case 0:
sdev->ordered_tags = sdev->simple_tags = 0;
sdev->queue_depth = tags;
break;
}
out:
spin_unlock_irqrestore(sdev->request_queue->queue_lock, flags);