scsi: hisi_sas: Coding style cleanup
authorYihang Li <liyihang9@huawei.com>
Mon, 14 Apr 2025 08:08:43 +0000 (16:08 +0800)
committerMartin K. Petersen <martin.petersen@oracle.com>
Tue, 22 Apr 2025 01:44:24 +0000 (21:44 -0400)
Remove superfluous blank lines and symbols. Add spaces around operators.

Signed-off-by: Yihang Li <liyihang9@huawei.com>
Link: https://lore.kernel.org/r/20250414080845.1220997-3-liyihang9@huawei.com
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/scsi/hisi_sas/hisi_sas.h
drivers/scsi/hisi_sas/hisi_sas_main.c
drivers/scsi/hisi_sas/hisi_sas_v1_hw.c
drivers/scsi/hisi_sas/hisi_sas_v2_hw.c
drivers/scsi/hisi_sas/hisi_sas_v3_hw.c

index 99ca26b96df25e913bb71a08e8ee2e4f69ecffc1..1323ed8aa7171e5a48db8ec7a30848fb9e92a273 100644 (file)
@@ -359,7 +359,7 @@ struct hisi_sas_hw {
        const struct scsi_host_template *sht;
 };
 
-#define HISI_SAS_MAX_DEBUGFS_DUMP (50)
+#define HISI_SAS_MAX_DEBUGFS_DUMP 50
 #define HISI_SAS_DEFAULT_DEBUGFS_DUMP 1
 
 struct hisi_sas_debugfs_cq {
@@ -460,12 +460,12 @@ struct hisi_hba {
        dma_addr_t sata_breakpoint_dma;
        struct hisi_sas_slot    *slot_info;
        unsigned long flags;
-       const struct hisi_sas_hw *hw;   /* Low level hw interface */
+       const struct hisi_sas_hw *hw; /* Low level hw interface */
        unsigned long sata_dev_bitmap[BITS_TO_LONGS(HISI_SAS_MAX_DEVICES)];
        struct work_struct rst_work;
        u32 phy_state;
-       u32 intr_coal_ticks;    /* Time of interrupt coalesce in us */
-       u32 intr_coal_count;    /* Interrupt count to coalesce */
+       u32 intr_coal_ticks; /* Time of interrupt coalesce in us */
+       u32 intr_coal_count; /* Interrupt count to coalesce */
 
        int cq_nvecs;
 
index 6326644ac9f6cd2506c07330ff3431a00992e5ad..d7f9d1d853cfe2415c74c340ead1b20b4eac7b3a 100644 (file)
@@ -124,12 +124,10 @@ u8 hisi_sas_get_ata_protocol(struct sas_task *task)
                }
 
        default:
-       {
                if (direction == DMA_NONE)
                        return HISI_SAS_SATA_PROTOCOL_NONDATA;
                return hisi_sas_get_ata_protocol_from_tf(qc);
        }
-       }
 }
 EXPORT_SYMBOL_GPL(hisi_sas_get_ata_protocol);
 
@@ -141,7 +139,7 @@ void hisi_sas_sata_done(struct sas_task *task,
        struct hisi_sas_status_buffer *status_buf =
                        hisi_sas_status_buf_addr_mem(slot);
        u8 *iu = &status_buf->iu[0];
-       struct dev_to_host_fis *d2h =  (struct dev_to_host_fis *)iu;
+       struct dev_to_host_fis *d2h = (struct dev_to_host_fis *)iu;
 
        resp->frame_len = sizeof(struct dev_to_host_fis);
        memcpy(&resp->ending_fis[0], d2h, sizeof(struct dev_to_host_fis));
@@ -1926,12 +1924,9 @@ static int hisi_sas_lu_reset(struct domain_device *device, u8 *lun)
        hisi_sas_dereg_device(hisi_hba, device);
 
        if (dev_is_sata(device)) {
-               struct sas_phy *phy;
-
-               phy = sas_get_local_phy(device);
+               struct sas_phy *phy = sas_get_local_phy(device);
 
                rc = sas_phy_reset(phy, true);
-
                if (rc == 0)
                        hisi_sas_release_task(hisi_hba, device);
                sas_put_local_phy(phy);
@@ -2115,7 +2110,7 @@ void hisi_sas_phy_down(struct hisi_hba *hisi_hba, int phy_no, int rdy,
                hisi_sas_bytes_dmaed(hisi_hba, phy_no, gfp_flags);
                hisi_sas_port_notify_formed(sas_phy);
        } else {
-               struct hisi_sas_port *port  = phy->port;
+               struct hisi_sas_port *port = phy->port;
 
                if (test_bit(HISI_SAS_RESETTING_BIT, &hisi_hba->flags) ||
                    phy->in_reset) {
index 6621d633b2ccc796e809aaf9ef73229d291941e8..6d97339371fbc5e5ee201db08848d33950e85bad 100644 (file)
@@ -1759,7 +1759,7 @@ static const struct scsi_host_template sht_v1_hw = {
        .sg_tablesize           = HISI_SAS_SGE_PAGE_CNT,
        .sdev_init              = hisi_sas_sdev_init,
        .shost_groups           = host_v1_hw_groups,
-       .host_reset             = hisi_sas_host_reset,
+       .host_reset             = hisi_sas_host_reset,
 };
 
 static const struct hisi_sas_hw hisi_sas_v1_hw = {
index a1fc400ab4c3c7f4d283b57d3f445e6bf1f3d086..61377039ce7109689583f7c3bf239bf85c13d62d 100644 (file)
@@ -2766,7 +2766,7 @@ static irqreturn_t int_phy_updown_v2_hw(int irq_no, void *p)
        irq_msk = (hisi_sas_read32(hisi_hba, HGC_INVLD_DQE_INFO)
                   >> HGC_INVLD_DQE_INFO_FB_CH0_OFF) & 0x1ff;
        while (irq_msk) {
-               if (irq_msk  & 1) {
+               if (irq_msk & 1) {
                        u32 reg_value = hisi_sas_phy_read32(hisi_hba, phy_no,
                                            CHL_INT0);
 
@@ -3106,7 +3106,7 @@ static irqreturn_t fatal_axi_int_v2_hw(int irq_no, void *p)
        return IRQ_HANDLED;
 }
 
-static irqreturn_t  cq_thread_v2_hw(int irq_no, void *p)
+static irqreturn_t cq_thread_v2_hw(int irq_no, void *p)
 {
        struct hisi_sas_cq *cq = p;
        struct hisi_hba *hisi_hba = cq->hisi_hba;
@@ -3494,7 +3494,7 @@ static int write_gpio_v2_hw(struct hisi_hba *hisi_hba, u8 reg_type,
                         * numbered drive in the fourth byte.
                         * See SFF-8485 Rev. 0.7 Table 24.
                         */
-                       void __iomem  *reg_addr = hisi_hba->sgpio_regs +
+                       void __iomem *reg_addr = hisi_hba->sgpio_regs +
                                        reg_index * 4 + phy_no;
                        int data_idx = phy_no + 3 - (phy_no % 4) * 2;
 
index e3e99bc5bbdf8c8247287e6bd4158906505de248..15f1d5d783cb210de5eb28efe28d59936b52c769 100644 (file)
@@ -1348,8 +1348,8 @@ static void prep_ssp_v3_hw(struct hisi_hba *hisi_hba,
        /* map itct entry */
        dw1 |= sas_dev->device_id << CMD_HDR_DEV_ID_OFF;
 
-       dw2 = (((sizeof(struct ssp_command_iu) + sizeof(struct ssp_frame_hdr)
-             + 3) / BYTE_TO_DW) << CMD_HDR_CFL_OFF) |
+       dw2 = (((sizeof(struct ssp_command_iu) + sizeof(struct ssp_frame_hdr) +
+                3) / BYTE_TO_DW) << CMD_HDR_CFL_OFF) |
              ((HISI_SAS_MAX_SSP_RESP_SZ / BYTE_TO_DW) << CMD_HDR_MRFL_OFF) |
              (HDR_SG_MOD << CMD_HDR_SG_MOD_OFF);
        hdr->dw2 = cpu_to_le32(dw2);
@@ -1740,7 +1740,7 @@ static irqreturn_t int_phy_up_down_bcast_v3_hw(int irq_no, void *p)
        irq_msk = hisi_sas_read32(hisi_hba, CHNL_INT_STATUS)
                                & 0x11111111;
        while (irq_msk) {
-               if (irq_msk  & 1) {
+               if (irq_msk & 1) {
                        u32 irq_value = hisi_sas_phy_read32(hisi_hba, phy_no,
                                                            CHL_INT0);
                        u32 phy_state = hisi_sas_read32(hisi_hba, PHY_STATE);
@@ -1963,8 +1963,7 @@ static irqreturn_t int_chnl_int_v3_hw(int irq_no, void *p)
        u32 irq_msk;
        int phy_no = 0;
 
-       irq_msk = hisi_sas_read32(hisi_hba, CHNL_INT_STATUS)
-                 & CHNL_INT_STS_MSK;
+       irq_msk = hisi_sas_read32(hisi_hba, CHNL_INT_STATUS) & CHNL_INT_STS_MSK;
 
        while (irq_msk) {
                if (irq_msk & (CHNL_INT_STS_INT0_MSK << (phy_no * CHNL_WIDTH)))
@@ -2609,7 +2608,6 @@ static int interrupt_preinit_v3_hw(struct hisi_hba *hisi_hba)
        if (vectors < 0)
                return -ENOENT;
 
-
        hisi_hba->cq_nvecs = vectors - BASE_VECTORS_V3_HW - hisi_hba->iopoll_q_cnt;
        shost->nr_hw_queues = hisi_hba->cq_nvecs + hisi_hba->iopoll_q_cnt;
 
@@ -3300,7 +3298,7 @@ static int debugfs_set_bist_v3_hw(struct hisi_hba *hisi_hba, bool enable)
                /* some preparations before bist test */
                hisi_sas_bist_test_prep_v3_hw(hisi_hba);
 
-               /* set linkrate of bit test*/
+               /* set linkrate of bit test */
                reg_val = hisi_sas_phy_read32(hisi_hba, phy_no,
                                              PROG_PHY_LINK_RATE);
                reg_val &= ~CFG_PROG_OOB_PHY_LINK_RATE_MSK;
@@ -3398,7 +3396,7 @@ static const struct scsi_host_template sht_v3_hw = {
        .shost_groups           = host_v3_hw_groups,
        .sdev_groups            = sdev_groups_v3_hw,
        .tag_alloc_policy_rr    = true,
-       .host_reset             = hisi_sas_host_reset,
+       .host_reset             = hisi_sas_host_reset,
        .host_tagset            = 1,
        .mq_poll                = queue_complete_v3_hw,
 };
@@ -3649,7 +3647,6 @@ static void debugfs_print_reg_v3_hw(u32 *regs_val, struct seq_file *s,
 
                name = debugfs_to_reg_name_v3_hw(off, reg->base_off,
                                                 reg->lu);
-
                if (name)
                        seq_printf(s, "0x%08x 0x%08x %s\n", off,
                                   regs_val[i], name);