Commit 4c7b4d63 authored by Bean Huo's avatar Bean Huo Committed by Martin K. Petersen

scsi: core: Fix formatting errors in scsi_lib.c

Delete trailing whitespace, multiple blank lines, and make switch/case be
at the same indentation.

Link: https://lore.kernel.org/r/20200619154117.10262-3-huobean@gmail.comSigned-off-by: default avatarBean Huo <beanhuo@micron.com>
Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
parent 71df6fb9
...@@ -389,7 +389,7 @@ static void scsi_single_lun_run(struct scsi_device *current_sdev) ...@@ -389,7 +389,7 @@ static void scsi_single_lun_run(struct scsi_device *current_sdev)
spin_unlock_irqrestore(shost->host_lock, flags); spin_unlock_irqrestore(shost->host_lock, flags);
scsi_kick_queue(sdev->request_queue); scsi_kick_queue(sdev->request_queue);
spin_lock_irqsave(shost->host_lock, flags); spin_lock_irqsave(shost->host_lock, flags);
scsi_device_put(sdev); scsi_device_put(sdev);
} }
out: out:
...@@ -1455,18 +1455,18 @@ static void scsi_softirq_done(struct request *rq) ...@@ -1455,18 +1455,18 @@ static void scsi_softirq_done(struct request *rq)
scsi_log_completion(cmd, disposition); scsi_log_completion(cmd, disposition);
switch (disposition) { switch (disposition) {
case SUCCESS: case SUCCESS:
scsi_finish_command(cmd); scsi_finish_command(cmd);
break; break;
case NEEDS_RETRY: case NEEDS_RETRY:
scsi_queue_insert(cmd, SCSI_MLQUEUE_EH_RETRY); scsi_queue_insert(cmd, SCSI_MLQUEUE_EH_RETRY);
break; break;
case ADD_TO_MLQUEUE: case ADD_TO_MLQUEUE:
scsi_queue_insert(cmd, SCSI_MLQUEUE_DEVICE_BUSY); scsi_queue_insert(cmd, SCSI_MLQUEUE_DEVICE_BUSY);
break; break;
default: default:
scsi_eh_scmd_add(cmd); scsi_eh_scmd_add(cmd);
break; break;
} }
} }
...@@ -2024,7 +2024,6 @@ scsi_mode_select(struct scsi_device *sdev, int pf, int sp, int modepage, ...@@ -2024,7 +2024,6 @@ scsi_mode_select(struct scsi_device *sdev, int pf, int sp, int modepage,
real_buffer[1] = data->medium_type; real_buffer[1] = data->medium_type;
real_buffer[2] = data->device_specific; real_buffer[2] = data->device_specific;
real_buffer[3] = data->block_descriptor_length; real_buffer[3] = data->block_descriptor_length;
cmd[0] = MODE_SELECT; cmd[0] = MODE_SELECT;
cmd[4] = len; cmd[4] = len;
...@@ -2110,7 +2109,7 @@ scsi_mode_sense(struct scsi_device *sdev, int dbd, int modepage, ...@@ -2110,7 +2109,7 @@ scsi_mode_sense(struct scsi_device *sdev, int dbd, int modepage,
if (scsi_sense_valid(sshdr)) { if (scsi_sense_valid(sshdr)) {
if ((sshdr->sense_key == ILLEGAL_REQUEST) && if ((sshdr->sense_key == ILLEGAL_REQUEST) &&
(sshdr->asc == 0x20) && (sshdr->ascq == 0)) { (sshdr->asc == 0x20) && (sshdr->ascq == 0)) {
/* /*
* Invalid command operation code * Invalid command operation code
*/ */
sdev->use_10_for_ms = 0; sdev->use_10_for_ms = 0;
...@@ -2119,7 +2118,7 @@ scsi_mode_sense(struct scsi_device *sdev, int dbd, int modepage, ...@@ -2119,7 +2118,7 @@ scsi_mode_sense(struct scsi_device *sdev, int dbd, int modepage,
} }
} }
if(scsi_status_is_good(result)) { if (scsi_status_is_good(result)) {
if (unlikely(buffer[0] == 0x86 && buffer[1] == 0x0b && if (unlikely(buffer[0] == 0x86 && buffer[1] == 0x0b &&
(modepage == 6 || modepage == 8))) { (modepage == 6 || modepage == 8))) {
/* Initio breakage? */ /* Initio breakage? */
...@@ -2129,7 +2128,7 @@ scsi_mode_sense(struct scsi_device *sdev, int dbd, int modepage, ...@@ -2129,7 +2128,7 @@ scsi_mode_sense(struct scsi_device *sdev, int dbd, int modepage,
data->device_specific = 0; data->device_specific = 0;
data->longlba = 0; data->longlba = 0;
data->block_descriptor_length = 0; data->block_descriptor_length = 0;
} else if(use_10_for_ms) { } else if (use_10_for_ms) {
data->length = buffer[0]*256 + buffer[1] + 2; data->length = buffer[0]*256 + buffer[1] + 2;
data->medium_type = buffer[2]; data->medium_type = buffer[2];
data->device_specific = buffer[3]; data->device_specific = buffer[3];
...@@ -2212,7 +2211,7 @@ scsi_device_set_state(struct scsi_device *sdev, enum scsi_device_state state) ...@@ -2212,7 +2211,7 @@ scsi_device_set_state(struct scsi_device *sdev, enum scsi_device_state state)
goto illegal; goto illegal;
} }
break; break;
case SDEV_RUNNING: case SDEV_RUNNING:
switch (oldstate) { switch (oldstate) {
case SDEV_CREATED: case SDEV_CREATED:
...@@ -2497,7 +2496,7 @@ EXPORT_SYMBOL_GPL(sdev_evt_send_simple); ...@@ -2497,7 +2496,7 @@ EXPORT_SYMBOL_GPL(sdev_evt_send_simple);
* (which must be a legal transition). When the device is in this * (which must be a legal transition). When the device is in this
* state, only special requests will be accepted, all others will * state, only special requests will be accepted, all others will
* be deferred. Since special requests may also be requeued requests, * be deferred. Since special requests may also be requeued requests,
* a successful return doesn't guarantee the device will be * a successful return doesn't guarantee the device will be
* totally quiescent. * totally quiescent.
* *
* Must be called with user context, may sleep. * Must be called with user context, may sleep.
...@@ -2623,10 +2622,10 @@ int scsi_internal_device_block_nowait(struct scsi_device *sdev) ...@@ -2623,10 +2622,10 @@ int scsi_internal_device_block_nowait(struct scsi_device *sdev)
return err; return err;
} }
/* /*
* The device has transitioned to SDEV_BLOCK. Stop the * The device has transitioned to SDEV_BLOCK. Stop the
* block layer from calling the midlayer with this device's * block layer from calling the midlayer with this device's
* request queue. * request queue.
*/ */
blk_mq_quiesce_queue_nowait(q); blk_mq_quiesce_queue_nowait(q);
return 0; return 0;
...@@ -2661,7 +2660,7 @@ static int scsi_internal_device_block(struct scsi_device *sdev) ...@@ -2661,7 +2660,7 @@ static int scsi_internal_device_block(struct scsi_device *sdev)
return err; return err;
} }
void scsi_start_queue(struct scsi_device *sdev) void scsi_start_queue(struct scsi_device *sdev)
{ {
struct request_queue *q = sdev->request_queue; struct request_queue *q = sdev->request_queue;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment