aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2014-11-13 09:11:59 -0500
committerChristoph Hellwig <hch@lst.de>2014-11-24 08:45:27 -0500
commit286c9408ec818060b6de2e617f92c40eb94d6fed (patch)
tree1ee267d0f2553c493c66a193e56782558e832656
parentdb5ed4dfd5dd0142ec36ff7b335e0ec3b836b3e6 (diff)
mpt2sas: simplify ->change_queue_depth
Merge two functions, and remove overly verbose debugging output that pokes into mid-layer internal structures. Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Mike Christie <michaelc@cs.wisc.edu> Reviewed-by: Hannes Reinecke <hare@suse.de>
-rw-r--r--drivers/scsi/mpt2sas/mpt2sas_scsih.c34
1 files changed, 5 insertions, 29 deletions
diff --git a/drivers/scsi/mpt2sas/mpt2sas_scsih.c b/drivers/scsi/mpt2sas/mpt2sas_scsih.c
index 12229de433bf..8431eb10bbb1 100644
--- a/drivers/scsi/mpt2sas/mpt2sas_scsih.c
+++ b/drivers/scsi/mpt2sas/mpt2sas_scsih.c
@@ -1179,15 +1179,14 @@ _scsih_build_scatter_gather(struct MPT2SAS_ADAPTER *ioc,
1179} 1179}
1180 1180
1181/** 1181/**
1182 * _scsih_adjust_queue_depth - setting device queue depth 1182 * _scsih_change_queue_depth - setting device queue depth
1183 * @sdev: scsi device struct 1183 * @sdev: scsi device struct
1184 * @qdepth: requested queue depth 1184 * @qdepth: requested queue depth
1185 * 1185 *
1186 * 1186 * Returns queue depth.
1187 * Returns nothing
1188 */ 1187 */
1189static void 1188static int
1190_scsih_adjust_queue_depth(struct scsi_device *sdev, int qdepth) 1189_scsih_change_queue_depth(struct scsi_device *sdev, int qdepth)
1191{ 1190{
1192 struct Scsi_Host *shost = sdev->host; 1191 struct Scsi_Host *shost = sdev->host;
1193 int max_depth; 1192 int max_depth;
@@ -1217,34 +1216,11 @@ _scsih_adjust_queue_depth(struct scsi_device *sdev, int qdepth)
1217 spin_unlock_irqrestore(&ioc->sas_device_lock, flags); 1216 spin_unlock_irqrestore(&ioc->sas_device_lock, flags);
1218 1217
1219 not_sata: 1218 not_sata:
1220
1221 if (!sdev->tagged_supported) 1219 if (!sdev->tagged_supported)
1222 max_depth = 1; 1220 max_depth = 1;
1223 if (qdepth > max_depth) 1221 if (qdepth > max_depth)
1224 qdepth = max_depth; 1222 qdepth = max_depth;
1225 scsi_change_queue_depth(sdev, qdepth); 1223 return scsi_change_queue_depth(sdev, qdepth);
1226}
1227
1228/**
1229 * _scsih_change_queue_depth - setting device queue depth
1230 * @sdev: scsi device struct
1231 * @qdepth: requested queue depth
1232 *
1233 * Returns queue depth.
1234 */
1235static int
1236_scsih_change_queue_depth(struct scsi_device *sdev, int qdepth)
1237{
1238 _scsih_adjust_queue_depth(sdev, qdepth);
1239
1240 if (sdev->inquiry_len > 7)
1241 sdev_printk(KERN_INFO, sdev, "qdepth(%d), tagged(%d), "
1242 "simple(%d), scsi_level(%d), cmd_que(%d)\n",
1243 sdev->queue_depth, sdev->tagged_supported, sdev->simple_tags,
1244 sdev->scsi_level,
1245 (sdev->inquiry[7] & 2) >> 1);
1246
1247 return sdev->queue_depth;
1248} 1224}
1249 1225
1250/** 1226/**