From: Douglas Gilbert Date: Mon, 7 Jul 2014 16:00:35 +0000 (+0200) Subject: scsi: cleanup switch in scsi_adjust_queue_depth X-Git-Tag: v4.9.8~5861^2~107 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=cb23f912a906d023940b54b403a1b7d6bfb97416;p=platform%2Fkernel%2Flinux-rpi3.git 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 Reviewed-by: Martin K. Petersen Reviewed-by: Robert Elliott Tested-by: Robert Elliott Signed-off-by: Christoph Hellwig --- diff --git a/drivers/scsi/scsi.c b/drivers/scsi/scsi.c index a76d76d..321f854 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) 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);