[PATCH] cleanup switch in scsi_adjust_queue_depth()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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

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

Signed-off-by: Douglas Gilbert <dgilbert@xxxxxxxxxxxx>
--- linux-3.15/drivers/scsi/scsi.c3151	2014-06-08 21:36:43.815551129 -0400
+++ linux-3.15/drivers/scsi/scsi.c	2014-06-24 19:17:02.474464807 -0400
@@ -850,6 +850,10 @@ void scsi_adjust_queue_depth(struct scsi
 
 	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;
@@ -859,13 +863,11 @@ void scsi_adjust_queue_depth(struct scsi
 			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);

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [SCSI Target Devel]     [Linux SCSI Target Infrastructure]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Samba]     [Device Mapper]
  Powered by Linux