diff options
author | Douglas Gilbert <dgilbert@interlog.com> | 2014-07-07 12:00:35 -0400 |
---|---|---|
committer | Christoph Hellwig <hch@lst.de> | 2014-07-17 16:07:45 -0400 |
commit | cb23f912a906d023940b54b403a1b7d6bfb97416 (patch) | |
tree | 6c4b3ae71009d59ef58c8daf10875b395deb098d | |
parent | f1bea55d5afa371c311b61946c58b2cd4e78fb2d (diff) |
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>
-rw-r--r-- | drivers/scsi/scsi.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/drivers/scsi/scsi.c b/drivers/scsi/scsi.c index a76d76df4209..321f854947b4 100644 --- a/drivers/scsi/scsi.c +++ b/drivers/scsi/scsi.c | |||
@@ -846,6 +846,10 @@ void scsi_adjust_queue_depth(struct scsi_device *sdev, int tagged, int tags) | |||
846 | 846 | ||
847 | sdev->queue_depth = tags; | 847 | sdev->queue_depth = tags; |
848 | switch (tagged) { | 848 | switch (tagged) { |
849 | case 0: | ||
850 | sdev->ordered_tags = 0; | ||
851 | sdev->simple_tags = 0; | ||
852 | break; | ||
849 | case MSG_ORDERED_TAG: | 853 | case MSG_ORDERED_TAG: |
850 | sdev->ordered_tags = 1; | 854 | sdev->ordered_tags = 1; |
851 | sdev->simple_tags = 1; | 855 | sdev->simple_tags = 1; |
@@ -855,13 +859,11 @@ void scsi_adjust_queue_depth(struct scsi_device *sdev, int tagged, int tags) | |||
855 | sdev->simple_tags = 1; | 859 | sdev->simple_tags = 1; |
856 | break; | 860 | break; |
857 | default: | 861 | default: |
862 | sdev->ordered_tags = 0; | ||
863 | sdev->simple_tags = 0; | ||
858 | sdev_printk(KERN_WARNING, sdev, | 864 | sdev_printk(KERN_WARNING, sdev, |
859 | "scsi_adjust_queue_depth, bad queue type, " | 865 | "scsi_adjust_queue_depth, bad queue type, " |
860 | "disabled\n"); | 866 | "disabled\n"); |
861 | case 0: | ||
862 | sdev->ordered_tags = sdev->simple_tags = 0; | ||
863 | sdev->queue_depth = tags; | ||
864 | break; | ||
865 | } | 867 | } |
866 | out: | 868 | out: |
867 | spin_unlock_irqrestore(sdev->request_queue->queue_lock, flags); | 869 | spin_unlock_irqrestore(sdev->request_queue->queue_lock, flags); |