From: Douglas Gilbert <dgilbert@interlog.com>
To: SCSI development list <linux-scsi@vger.kernel.org>,
Christoph Hellwig <hch@lst.de>,
James Bottomley <james.bottomley@hansenpartnership.com>
Subject: [PATCH] cleanup switch in scsi_adjust_queue_depth()
Date: Tue, 24 Jun 2014 19:23:45 -0400 [thread overview]
Message-ID: <53AA0881.5000505@interlog.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 276 bytes --]
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@interlog.com>
[-- Attachment #2: scsi_adjust_queue_depth1.patch --]
[-- Type: text/x-patch, Size: 873 bytes --]
--- 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);
next reply other threads:[~2014-06-24 23:23 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-06-24 23:23 Douglas Gilbert [this message]
2014-06-26 2:14 ` [PATCH] cleanup switch in scsi_adjust_queue_depth() Martin K. Petersen
2014-07-01 20:40 ` Elliott, Robert (Server Storage)
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=53AA0881.5000505@interlog.com \
--to=dgilbert@interlog.com \
--cc=hch@lst.de \
--cc=james.bottomley@hansenpartnership.com \
--cc=linux-scsi@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.