Skip to content

Commit 01d4e3a

Browse files
Xiang Chenmartinkpetersen
authored andcommitted
scsi: hisi_sas: Some misc tidy-up
Do some minor tidy-up. Signed-off-by: Xiang Chen <chenxiang66@hisilicon.com> Signed-off-by: John Garry <john.garry@huawei.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
1 parent 246ea3c commit 01d4e3a

4 files changed

Lines changed: 38 additions & 53 deletions

File tree

‎drivers/scsi/hisi_sas/hisi_sas_main.c‎

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -683,7 +683,7 @@ static void hisi_sas_bytes_dmaed(struct hisi_hba *hisi_hba, int phy_no)
683683
id->initiator_bits = SAS_PROTOCOL_ALL;
684684
id->target_bits = phy->identify.target_port_protocols;
685685
} else if (phy->phy_type & PORT_TYPE_SATA) {
686-
/*Nothing*/
686+
/* Nothing */
687687
}
688688

689689
sas_phy->frame_rcvd_size = phy->frame_rcvd_size;
@@ -1739,7 +1739,7 @@ static int hisi_sas_abort_task_set(struct domain_device *device, u8 *lun)
17391739
struct hisi_hba *hisi_hba = dev_to_hisi_hba(device);
17401740
struct device *dev = hisi_hba->dev;
17411741
struct hisi_sas_tmf_task tmf_task;
1742-
int rc = TMF_RESP_FUNC_FAILED;
1742+
int rc;
17431743

17441744
rc = hisi_sas_internal_task_abort(hisi_hba, device,
17451745
HISI_SAS_INT_ABT_DEV, 0);
@@ -2532,22 +2532,19 @@ int hisi_sas_get_fw_info(struct hisi_hba *hisi_hba)
25322532

25332533
if (device_property_read_u32(dev, "ctrl-reset-reg",
25342534
&hisi_hba->ctrl_reset_reg)) {
2535-
dev_err(dev,
2536-
"could not get property ctrl-reset-reg\n");
2535+
dev_err(dev, "could not get property ctrl-reset-reg\n");
25372536
return -ENOENT;
25382537
}
25392538

25402539
if (device_property_read_u32(dev, "ctrl-reset-sts-reg",
25412540
&hisi_hba->ctrl_reset_sts_reg)) {
2542-
dev_err(dev,
2543-
"could not get property ctrl-reset-sts-reg\n");
2541+
dev_err(dev, "could not get property ctrl-reset-sts-reg\n");
25442542
return -ENOENT;
25452543
}
25462544

25472545
if (device_property_read_u32(dev, "ctrl-clock-ena-reg",
25482546
&hisi_hba->ctrl_clock_ena_reg)) {
2549-
dev_err(dev,
2550-
"could not get property ctrl-clock-ena-reg\n");
2547+
dev_err(dev, "could not get property ctrl-clock-ena-reg\n");
25512548
return -ENOENT;
25522549
}
25532550
}

‎drivers/scsi/hisi_sas/hisi_sas_v1_hw.c‎

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1690,17 +1690,15 @@ static int interrupt_init_v1_hw(struct hisi_hba *hisi_hba)
16901690
for (j = 0; j < HISI_SAS_PHY_INT_NR; j++, idx++) {
16911691
irq = platform_get_irq(pdev, idx);
16921692
if (!irq) {
1693-
dev_err(dev,
1694-
"irq init: fail map phy interrupt %d\n",
1693+
dev_err(dev, "irq init: fail map phy interrupt %d\n",
16951694
idx);
16961695
return -ENOENT;
16971696
}
16981697

16991698
rc = devm_request_irq(dev, irq, phy_interrupts[j], 0,
17001699
DRV_NAME " phy", phy);
17011700
if (rc) {
1702-
dev_err(dev, "irq init: could not request "
1703-
"phy interrupt %d, rc=%d\n",
1701+
dev_err(dev, "irq init: could not request phy interrupt %d, rc=%d\n",
17041702
irq, rc);
17051703
return -ENOENT;
17061704
}
@@ -1737,8 +1735,7 @@ static int interrupt_init_v1_hw(struct hisi_hba *hisi_hba)
17371735
rc = devm_request_irq(dev, irq, fatal_interrupts[i], 0,
17381736
DRV_NAME " fatal", hisi_hba);
17391737
if (rc) {
1740-
dev_err(dev,
1741-
"irq init: could not request fatal interrupt %d, rc=%d\n",
1738+
dev_err(dev, "irq init: could not request fatal interrupt %d, rc=%d\n",
17421739
irq, rc);
17431740
return -ENOENT;
17441741
}

‎drivers/scsi/hisi_sas/hisi_sas_v2_hw.c‎

Lines changed: 18 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -2423,14 +2423,12 @@ slot_complete_v2_hw(struct hisi_hba *hisi_hba, struct hisi_sas_slot *slot)
24232423
slot_err_v2_hw(hisi_hba, task, slot, 2);
24242424

24252425
if (ts->stat != SAS_DATA_UNDERRUN)
2426-
dev_info(dev, "erroneous completion iptt=%d task=%p dev id=%d "
2427-
"CQ hdr: 0x%x 0x%x 0x%x 0x%x "
2428-
"Error info: 0x%x 0x%x 0x%x 0x%x\n",
2429-
slot->idx, task, sas_dev->device_id,
2430-
complete_hdr->dw0, complete_hdr->dw1,
2431-
complete_hdr->act, complete_hdr->dw3,
2432-
error_info[0], error_info[1],
2433-
error_info[2], error_info[3]);
2426+
dev_info(dev, "erroneous completion iptt=%d task=%p dev id=%d CQ hdr: 0x%x 0x%x 0x%x 0x%x Error info: 0x%x 0x%x 0x%x 0x%x\n",
2427+
slot->idx, task, sas_dev->device_id,
2428+
complete_hdr->dw0, complete_hdr->dw1,
2429+
complete_hdr->act, complete_hdr->dw3,
2430+
error_info[0], error_info[1],
2431+
error_info[2], error_info[3]);
24342432

24352433
if (unlikely(slot->abort))
24362434
return ts->stat;
@@ -2502,7 +2500,7 @@ slot_complete_v2_hw(struct hisi_hba *hisi_hba, struct hisi_sas_slot *slot)
25022500
spin_lock_irqsave(&device->done_lock, flags);
25032501
if (test_bit(SAS_HA_FROZEN, &ha->state)) {
25042502
spin_unlock_irqrestore(&device->done_lock, flags);
2505-
dev_info(dev, "slot complete: task(%p) ignored\n ",
2503+
dev_info(dev, "slot complete: task(%p) ignored\n",
25062504
task);
25072505
return sts;
25082506
}
@@ -2935,7 +2933,7 @@ static irqreturn_t int_chnl_int_v2_hw(int irq_no, void *p)
29352933

29362934
if (irq_value2 & BIT(CHL_INT2_SL_IDAF_TOUT_CONF_OFF)) {
29372935
dev_warn(dev, "phy%d identify timeout\n",
2938-
phy_no);
2936+
phy_no);
29392937
hisi_sas_notify_phy_event(phy,
29402938
HISI_PHYE_LINK_RESET);
29412939
}
@@ -3036,7 +3034,7 @@ static const struct hisi_sas_hw_error axi_error[] = {
30363034
{ .msk = BIT(5), .msg = "SATA_AXI_R_ERR" },
30373035
{ .msk = BIT(6), .msg = "DQE_AXI_R_ERR" },
30383036
{ .msk = BIT(7), .msg = "CQE_AXI_W_ERR" },
3039-
{},
3037+
{}
30403038
};
30413039

30423040
static const struct hisi_sas_hw_error fifo_error[] = {
@@ -3045,7 +3043,7 @@ static const struct hisi_sas_hw_error fifo_error[] = {
30453043
{ .msk = BIT(10), .msg = "GETDQE_FIFO" },
30463044
{ .msk = BIT(11), .msg = "CMDP_FIFO" },
30473045
{ .msk = BIT(12), .msg = "AWTCTRL_FIFO" },
3048-
{},
3046+
{}
30493047
};
30503048

30513049
static const struct hisi_sas_hw_error fatal_axi_errors[] = {
@@ -3109,12 +3107,12 @@ static irqreturn_t fatal_axi_int_v2_hw(int irq_no, void *p)
31093107
if (!(err_value & sub->msk))
31103108
continue;
31113109
dev_err(dev, "%s (0x%x) found!\n",
3112-
sub->msg, irq_value);
3110+
sub->msg, irq_value);
31133111
queue_work(hisi_hba->wq, &hisi_hba->rst_work);
31143112
}
31153113
} else {
31163114
dev_err(dev, "%s (0x%x) found!\n",
3117-
axi_error->msg, irq_value);
3115+
axi_error->msg, irq_value);
31183116
queue_work(hisi_hba->wq, &hisi_hba->rst_work);
31193117
}
31203118
}
@@ -3258,7 +3256,7 @@ static irqreturn_t sata_int_v2_hw(int irq_no, void *p)
32583256
/* check ERR bit of Status Register */
32593257
if (fis->status & ATA_ERR) {
32603258
dev_warn(dev, "sata int: phy%d FIS status: 0x%x\n", phy_no,
3261-
fis->status);
3259+
fis->status);
32623260
hisi_sas_notify_phy_event(phy, HISI_PHYE_LINK_RESET);
32633261
res = IRQ_NONE;
32643262
goto end;
@@ -3349,8 +3347,7 @@ static int interrupt_init_v2_hw(struct hisi_hba *hisi_hba)
33493347
rc = devm_request_irq(dev, irq, phy_interrupts[i], 0,
33503348
DRV_NAME " phy", hisi_hba);
33513349
if (rc) {
3352-
dev_err(dev, "irq init: could not request "
3353-
"phy interrupt %d, rc=%d\n",
3350+
dev_err(dev, "irq init: could not request phy interrupt %d, rc=%d\n",
33543351
irq, rc);
33553352
rc = -ENOENT;
33563353
goto free_phy_int_irqs;
@@ -3364,8 +3361,7 @@ static int interrupt_init_v2_hw(struct hisi_hba *hisi_hba)
33643361
rc = devm_request_irq(dev, irq, sata_int_v2_hw, 0,
33653362
DRV_NAME " sata", phy);
33663363
if (rc) {
3367-
dev_err(dev, "irq init: could not request "
3368-
"sata interrupt %d, rc=%d\n",
3364+
dev_err(dev, "irq init: could not request sata interrupt %d, rc=%d\n",
33693365
irq, rc);
33703366
rc = -ENOENT;
33713367
goto free_sata_int_irqs;
@@ -3377,8 +3373,7 @@ static int interrupt_init_v2_hw(struct hisi_hba *hisi_hba)
33773373
rc = devm_request_irq(dev, irq, fatal_interrupts[fatal_no], 0,
33783374
DRV_NAME " fatal", hisi_hba);
33793375
if (rc) {
3380-
dev_err(dev,
3381-
"irq init: could not request fatal interrupt %d, rc=%d\n",
3376+
dev_err(dev, "irq init: could not request fatal interrupt %d, rc=%d\n",
33823377
irq, rc);
33833378
rc = -ENOENT;
33843379
goto free_fatal_int_irqs;
@@ -3393,8 +3388,7 @@ static int interrupt_init_v2_hw(struct hisi_hba *hisi_hba)
33933388
rc = devm_request_irq(dev, irq, cq_interrupt_v2_hw, 0,
33943389
DRV_NAME " cq", cq);
33953390
if (rc) {
3396-
dev_err(dev,
3397-
"irq init: could not request cq interrupt %d, rc=%d\n",
3391+
dev_err(dev, "irq init: could not request cq interrupt %d, rc=%d\n",
33983392
irq, rc);
33993393
rc = -ENOENT;
34003394
goto free_cq_int_irqs;
@@ -3546,7 +3540,7 @@ static int write_gpio_v2_hw(struct hisi_hba *hisi_hba, u8 reg_type,
35463540
break;
35473541
default:
35483542
dev_err(dev, "write gpio: unsupported or bad reg type %d\n",
3549-
reg_type);
3543+
reg_type);
35503544
return -EINVAL;
35513545
}
35523546

‎drivers/scsi/hisi_sas/hisi_sas_v3_hw.c‎

Lines changed: 12 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1010,7 +1010,7 @@ get_free_slot_v3_hw(struct hisi_hba *hisi_hba, struct hisi_sas_dq *dq)
10101010
DLVRY_Q_0_RD_PTR + (queue * 0x14));
10111011
if (r == (w+1) % HISI_SAS_QUEUE_SLOTS) {
10121012
dev_warn(dev, "full queue=%d r=%d w=%d\n",
1013-
queue, r, w);
1013+
queue, r, w);
10141014
return -EAGAIN;
10151015
}
10161016

@@ -1950,7 +1950,7 @@ static const struct hisi_sas_hw_error axi_error[] = {
19501950
{ .msk = BIT(5), .msg = "SATA_AXI_R_ERR" },
19511951
{ .msk = BIT(6), .msg = "DQE_AXI_R_ERR" },
19521952
{ .msk = BIT(7), .msg = "CQE_AXI_W_ERR" },
1953-
{},
1953+
{}
19541954
};
19551955

19561956
static const struct hisi_sas_hw_error fifo_error[] = {
@@ -1959,7 +1959,7 @@ static const struct hisi_sas_hw_error fifo_error[] = {
19591959
{ .msk = BIT(10), .msg = "GETDQE_FIFO" },
19601960
{ .msk = BIT(11), .msg = "CMDP_FIFO" },
19611961
{ .msk = BIT(12), .msg = "AWTCTRL_FIFO" },
1962-
{},
1962+
{}
19631963
};
19641964

19651965
static const struct hisi_sas_hw_error fatal_axi_error[] = {
@@ -2207,13 +2207,11 @@ slot_complete_v3_hw(struct hisi_hba *hisi_hba, struct hisi_sas_slot *slot)
22072207

22082208
slot_err_v3_hw(hisi_hba, task, slot);
22092209
if (ts->stat != SAS_DATA_UNDERRUN)
2210-
dev_info(dev, "erroneous completion iptt=%d task=%p dev id=%d "
2211-
"CQ hdr: 0x%x 0x%x 0x%x 0x%x "
2212-
"Error info: 0x%x 0x%x 0x%x 0x%x\n",
2213-
slot->idx, task, sas_dev->device_id,
2214-
dw0, dw1, complete_hdr->act, dw3,
2215-
error_info[0], error_info[1],
2216-
error_info[2], error_info[3]);
2210+
dev_info(dev, "erroneous completion iptt=%d task=%p dev id=%d CQ hdr: 0x%x 0x%x 0x%x 0x%x Error info: 0x%x 0x%x 0x%x 0x%x\n",
2211+
slot->idx, task, sas_dev->device_id,
2212+
dw0, dw1, complete_hdr->act, dw3,
2213+
error_info[0], error_info[1],
2214+
error_info[2], error_info[3]);
22172215
if (unlikely(slot->abort))
22182216
return ts->stat;
22192217
goto out;
@@ -2446,8 +2444,7 @@ static int interrupt_init_v3_hw(struct hisi_hba *hisi_hba)
24462444
cq_interrupt_v3_hw, irqflags,
24472445
DRV_NAME " cq", cq);
24482446
if (rc) {
2449-
dev_err(dev,
2450-
"could not request cq%d interrupt, rc=%d\n",
2447+
dev_err(dev, "could not request cq%d interrupt, rc=%d\n",
24512448
i, rc);
24522449
rc = -ENOENT;
24532450
goto free_cq_irqs;
@@ -2603,7 +2600,7 @@ static int write_gpio_v3_hw(struct hisi_hba *hisi_hba, u8 reg_type,
26032600
break;
26042601
default:
26052602
dev_err(dev, "write gpio: unsupported or bad reg type %d\n",
2606-
reg_type);
2603+
reg_type);
26072604
return -EINVAL;
26082605
}
26092606

@@ -3042,7 +3039,7 @@ hisi_sas_v3_probe(struct pci_dev *pdev, const struct pci_device_id *id)
30423039

30433040
hisi_hba->regs = pcim_iomap(pdev, 5, 0);
30443041
if (!hisi_hba->regs) {
3045-
dev_err(dev, "cannot map register.\n");
3042+
dev_err(dev, "cannot map register\n");
30463043
rc = -ENOMEM;
30473044
goto err_out_ha;
30483045
}
@@ -3258,7 +3255,7 @@ static int hisi_sas_v3_resume(struct pci_dev *pdev)
32583255
pci_power_t device_state = pdev->current_state;
32593256

32603257
dev_warn(dev, "resuming from operating state [D%d]\n",
3261-
device_state);
3258+
device_state);
32623259
pci_set_power_state(pdev, PCI_D0);
32633260
pci_enable_wake(pdev, PCI_D0, 0);
32643261
pci_restore_state(pdev);

0 commit comments

Comments
 (0)