Commit cb23f912 authored by Douglas Gilbert's avatar Douglas Gilbert Committed by Christoph Hellwig

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: default avatarDouglas Gilbert <dgilbert@interlog.com>
Reviewed-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
Reviewed-by: default avatarRobert Elliott <elliott@hp.com>
Tested-by: default avatarRobert Elliott <elliott@hp.com>
Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
parent f1bea55d
...@@ -846,6 +846,10 @@ void scsi_adjust_queue_depth(struct scsi_device *sdev, int tagged, int tags) ...@@ -846,6 +846,10 @@ void scsi_adjust_queue_depth(struct scsi_device *sdev, int tagged, int tags)
sdev->queue_depth = tags; sdev->queue_depth = tags;
switch (tagged) { switch (tagged) {
case 0:
sdev->ordered_tags = 0;
sdev->simple_tags = 0;
break;
case MSG_ORDERED_TAG: case MSG_ORDERED_TAG:
sdev->ordered_tags = 1; sdev->ordered_tags = 1;
sdev->simple_tags = 1; sdev->simple_tags = 1;
...@@ -855,13 +859,11 @@ void scsi_adjust_queue_depth(struct scsi_device *sdev, int tagged, int tags) ...@@ -855,13 +859,11 @@ void scsi_adjust_queue_depth(struct scsi_device *sdev, int tagged, int tags)
sdev->simple_tags = 1; sdev->simple_tags = 1;
break; break;
default: default:
sdev->ordered_tags = 0;
sdev->simple_tags = 0;
sdev_printk(KERN_WARNING, sdev, sdev_printk(KERN_WARNING, sdev,
"scsi_adjust_queue_depth, bad queue type, " "scsi_adjust_queue_depth, bad queue type, "
"disabled\n"); "disabled\n");
case 0:
sdev->ordered_tags = sdev->simple_tags = 0;
sdev->queue_depth = tags;
break;
} }
out: out:
spin_unlock_irqrestore(sdev->request_queue->queue_lock, flags); spin_unlock_irqrestore(sdev->request_queue->queue_lock, flags);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment