Skip to content

Commit

Permalink
mpt3sas: simplify ->change_queue_depth
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Christoph Hellwig committed Nov 24, 2014
1 parent 286c940 commit cf75d5d
Showing 1 changed file with 10 additions and 26 deletions.
36 changes: 10 additions & 26 deletions drivers/scsi/mpt3sas/mpt3sas_scsih.c
Original file line number Diff line number Diff line change
Expand Up @@ -1053,9 +1053,15 @@ _scsih_scsi_lookup_find_by_lun(struct MPT3SAS_ADAPTER *ioc, int id,
return found;
}


static void
_scsih_adjust_queue_depth(struct scsi_device *sdev, int qdepth)
/**
* _scsih_change_queue_depth - setting device queue depth
* @sdev: scsi device struct
* @qdepth: requested queue depth
*
* Returns queue depth.
*/
static int
_scsih_change_queue_depth(struct scsi_device *sdev, int qdepth)
{
struct Scsi_Host *shost = sdev->host;
int max_depth;
Expand Down Expand Up @@ -1090,29 +1096,7 @@ _scsih_adjust_queue_depth(struct scsi_device *sdev, int qdepth)
max_depth = 1;
if (qdepth > max_depth)
qdepth = max_depth;
scsi_change_queue_depth(sdev, qdepth);
}

/**
* _scsih_change_queue_depth - setting device queue depth
* @sdev: scsi device struct
* @qdepth: requested queue depth
*
* Returns queue depth.
*/
static int
_scsih_change_queue_depth(struct scsi_device *sdev, int qdepth)
{
_scsih_adjust_queue_depth(sdev, qdepth);

if (sdev->inquiry_len > 7)
sdev_printk(KERN_INFO, sdev, "qdepth(%d), tagged(%d), " \
"simple(%d), scsi_level(%d), cmd_que(%d)\n",
sdev->queue_depth, sdev->tagged_supported, sdev->simple_tags,
sdev->scsi_level,
(sdev->inquiry[7] & 2) >> 1);

return sdev->queue_depth;
return scsi_change_queue_depth(sdev, qdepth);
}

/**
Expand Down

0 comments on commit cf75d5d

Please sign in to comment.