From patchwork Sat Apr 10 06:48:00 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: luojiaxing X-Patchwork-Id: 419100 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1EE0AC43460 for ; Sat, 10 Apr 2021 06:47:59 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id CD19C61208 for ; Sat, 10 Apr 2021 06:47:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234388AbhDJGsM (ORCPT ); Sat, 10 Apr 2021 02:48:12 -0400 Received: from szxga06-in.huawei.com ([45.249.212.32]:16886 "EHLO szxga06-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233606AbhDJGsJ (ORCPT ); Sat, 10 Apr 2021 02:48:09 -0400 Received: from DGGEMS411-HUB.china.huawei.com (unknown [172.30.72.58]) by szxga06-in.huawei.com (SkyGuard) with ESMTP id 4FHQWJ6ZnZzkht2; Sat, 10 Apr 2021 14:46:04 +0800 (CST) Received: from huawei.com (10.69.192.56) by DGGEMS411-HUB.china.huawei.com (10.3.19.211) with Microsoft SMTP Server id 14.3.498.0; Sat, 10 Apr 2021 14:47:43 +0800 From: Luo Jiaxing To: , , , , CC: , , , , Subject: [PATCH v1 1/8] scsi: megaraid: clean up for white space Date: Sat, 10 Apr 2021 14:48:00 +0800 Message-ID: <1618037287-460-2-git-send-email-luojiaxing@huawei.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1618037287-460-1-git-send-email-luojiaxing@huawei.com> References: <1618037287-460-1-git-send-email-luojiaxing@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.69.192.56] X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org Several kinds of error about white space is reported when running checkpatch.pl: ERROR: space required after that ',' (ctx:VxV) + "commands to complete\n",i,outstanding); ERROR: trailing whitespace +^I^I^Idma_pool_free(pool->handle, kioc->buf_vaddr, $ ERROR: need consistent spacing around '*' (ctx:WxV) + u32 reply_q_sz = sizeof(u32) *(instance->max_mfi_cmds + 1); so fix them together here. Signed-off-by: Luo Jiaxing --- drivers/scsi/megaraid/mbox_defs.h | 20 +++++++++---------- drivers/scsi/megaraid/megaraid_ioctl.h | 4 ++-- drivers/scsi/megaraid/megaraid_mbox.c | 24 +++++++++++----------- drivers/scsi/megaraid/megaraid_mm.c | 26 ++++++++++++------------ drivers/scsi/megaraid/megaraid_sas_base.c | 33 ++++++++++++++++++++----------- 5 files changed, 58 insertions(+), 49 deletions(-) diff --git a/drivers/scsi/megaraid/mbox_defs.h b/drivers/scsi/megaraid/mbox_defs.h index f0ef8f7..5001624 100644 --- a/drivers/scsi/megaraid/mbox_defs.h +++ b/drivers/scsi/megaraid/mbox_defs.h @@ -588,7 +588,7 @@ typedef struct { typedef struct { uint8_t channel; uint8_t target; -}__attribute__ ((packed)) adap_device_t; +} __attribute__ ((packed)) adap_device_t; /** @@ -600,7 +600,7 @@ typedef struct { uint32_t start_blk; uint32_t num_blks; adap_device_t device[MAX_ROW_SIZE_40LD]; -}__attribute__ ((packed)) adap_span_40ld_t; +} __attribute__ ((packed)) adap_span_40ld_t; /** @@ -612,7 +612,7 @@ typedef struct { uint32_t start_blk; uint32_t num_blks; adap_device_t device[MAX_ROW_SIZE_8LD]; -}__attribute__ ((packed)) adap_span_8ld_t; +} __attribute__ ((packed)) adap_span_8ld_t; /** @@ -647,7 +647,7 @@ typedef struct { typedef struct { logdrv_param_t lparam; adap_span_40ld_t span[SPAN_DEPTH_8_SPANS]; -}__attribute__ ((packed)) logdrv_40ld_t; +} __attribute__ ((packed)) logdrv_40ld_t; /** @@ -660,7 +660,7 @@ typedef struct { typedef struct { logdrv_param_t lparam; adap_span_8ld_t span[SPAN_DEPTH_8_SPANS]; -}__attribute__ ((packed)) logdrv_8ld_span8_t; +} __attribute__ ((packed)) logdrv_8ld_span8_t; /** @@ -673,7 +673,7 @@ typedef struct { typedef struct { logdrv_param_t lparam; adap_span_8ld_t span[SPAN_DEPTH_4_SPANS]; -}__attribute__ ((packed)) logdrv_8ld_span4_t; +} __attribute__ ((packed)) logdrv_8ld_span4_t; /** @@ -690,7 +690,7 @@ typedef struct { uint8_t tag_depth; uint8_t sync_neg; uint32_t size; -}__attribute__ ((packed)) phys_drive_t; +} __attribute__ ((packed)) phys_drive_t; /** @@ -705,7 +705,7 @@ typedef struct { uint8_t resvd[3]; logdrv_40ld_t ldrv[MAX_LOGICAL_DRIVES_40LD]; phys_drive_t pdrv[MBOX_MAX_PHYSICAL_DRIVES]; -}__attribute__ ((packed)) disk_array_40ld_t; +} __attribute__ ((packed)) disk_array_40ld_t; /** @@ -722,7 +722,7 @@ typedef struct { uint8_t resvd[3]; logdrv_8ld_span8_t ldrv[MAX_LOGICAL_DRIVES_8LD]; phys_drive_t pdrv[MBOX_MAX_PHYSICAL_DRIVES]; -}__attribute__ ((packed)) disk_array_8ld_span8_t; +} __attribute__ ((packed)) disk_array_8ld_span8_t; /** @@ -739,7 +739,7 @@ typedef struct { uint8_t resvd[3]; logdrv_8ld_span4_t ldrv[MAX_LOGICAL_DRIVES_8LD]; phys_drive_t pdrv[MBOX_MAX_PHYSICAL_DRIVES]; -}__attribute__ ((packed)) disk_array_8ld_span4_t; +} __attribute__ ((packed)) disk_array_8ld_span4_t; /** diff --git a/drivers/scsi/megaraid/megaraid_ioctl.h b/drivers/scsi/megaraid/megaraid_ioctl.h index ae9c2ff..d0ae6f9 100644 --- a/drivers/scsi/megaraid/megaraid_ioctl.h +++ b/drivers/scsi/megaraid/megaraid_ioctl.h @@ -76,7 +76,7 @@ #define DRVRTYPE_MBOX 0x00000001 /* regular mbox driver */ #define DRVRTYPE_HPE 0x00000002 /* new hpe driver */ -#define MKADAP(adapno) (MEGAIOC_MAGIC << 8 | (adapno) ) +#define MKADAP(adapno) (MEGAIOC_MAGIC << 8 | (adapno)) #define GETADAP(mkadap) ((mkadap) ^ MEGAIOC_MAGIC << 8) #define MAX_DMA_POOLS 5 /* 4k, 8k, 16k, 32k, 64k*/ @@ -148,7 +148,7 @@ typedef struct uioc { uint8_t timedout; -} __attribute__ ((aligned(1024),packed)) uioc_t; +} __attribute__ ((aligned(1024), packed)) uioc_t; /* For on-stack uioc timers. */ struct uioc_timeout { diff --git a/drivers/scsi/megaraid/megaraid_mbox.c b/drivers/scsi/megaraid/megaraid_mbox.c index 145fde3..6d76b15 100644 --- a/drivers/scsi/megaraid/megaraid_mbox.c +++ b/drivers/scsi/megaraid/megaraid_mbox.c @@ -736,7 +736,7 @@ megaraid_init_mbox(adapter_t *adapter) if (!raid_dev->baseaddr) { con_log(CL_ANN, (KERN_WARNING - "megaraid: could not map hba memory\n") ); + "megaraid: could not map hba memory\n")); goto out_release_regions; } @@ -1396,7 +1396,7 @@ mbox_post_cmd(adapter_t *adapter, scb_t *scb) udelay(1); i++; rmb(); - } while(mbox->busy && (i < max_mbox_busy_wait)); + } while (mbox->busy && (i < max_mbox_busy_wait)); if (mbox->busy) { @@ -1629,7 +1629,7 @@ megaraid_mbox_build_cmd(adapter_t *adapter, struct scsi_cmnd *scp, int *busy) scb); mbox->xferaddr = 0xFFFFFFFF; - mbox64->xferaddr_lo = (uint32_t )ccb->pthru_dma_h; + mbox64->xferaddr_lo = (uint32_t)ccb->pthru_dma_h; mbox64->xferaddr_hi = 0; return scb; @@ -1660,7 +1660,7 @@ megaraid_mbox_build_cmd(adapter_t *adapter, struct scsi_cmnd *scp, int *busy) * A little HACK: 2nd bit is zero for all scsi read * commands and is set for all scsi write commands */ - mbox->cmd = (scp->cmnd[0] & 0x02) ? MBOXCMD_LWRITE64: + mbox->cmd = (scp->cmnd[0] & 0x02) ? MBOXCMD_LWRITE64 : MBOXCMD_LREAD64 ; /* @@ -1719,7 +1719,7 @@ megaraid_mbox_build_cmd(adapter_t *adapter, struct scsi_cmnd *scp, int *busy) scb->dma_direction = scp->sc_data_direction; // Calculate Scatter-Gather info - mbox64->xferaddr_lo = (uint32_t )ccb->sgl_dma_h; + mbox64->xferaddr_lo = (uint32_t)ccb->sgl_dma_h; mbox->numsge = megaraid_mbox_mksgl(adapter, scb); mbox->xferaddr = 0xFFFFFFFF; @@ -1775,7 +1775,7 @@ megaraid_mbox_build_cmd(adapter_t *adapter, struct scsi_cmnd *scp, int *busy) // over, reset the fast_load flag so that during a possible // next scan, devices can be made available if (rdev->fast_load && (target == 15) && - (SCP2CHANNEL(scp) == adapter->max_channel -1)) { + (SCP2CHANNEL(scp) == adapter->max_channel - 1)) { con_log(CL_ANN, (KERN_INFO "megaraid[%d]: physical device scan re-enabled\n", @@ -1946,7 +1946,7 @@ megaraid_mbox_prepare_pthru(adapter_t *adapter, scb_t *scb, target = scb->dev_target; // 0=6sec, 1=60sec, 2=10min, 3=3hrs, 4=NO timeout - pthru->timeout = 4; + pthru->timeout = 4; pthru->ars = 1; pthru->islogical = 0; pthru->channel = 0; @@ -1995,7 +1995,7 @@ megaraid_mbox_prepare_epthru(adapter_t *adapter, scb_t *scb, target = scb->dev_target; // 0=6sec, 1=60sec, 2=10min, 3=3hrs, 4=NO timeout - epthru->timeout = 4; + epthru->timeout = 4; epthru->ars = 1; epthru->islogical = 0; epthru->channel = 0; @@ -2113,7 +2113,7 @@ megaraid_ack_sequence(adapter_t *adapter) // Acknowledge interrupt WRINDOOR(raid_dev, 0x02); - } while(1); + } while (1); spin_unlock_irqrestore(MAILBOX_LOCK(raid_dev), flags); @@ -2267,7 +2267,7 @@ megaraid_mbox_dpc(unsigned long devp) c = 0; } - if ((c & 0x1F ) == TYPE_DISK) { + if ((c & 0x1F) == TYPE_DISK) { pdev_index = (scb->dev_channel * 16) + scb->dev_target; pdev_state = @@ -2785,7 +2785,7 @@ mbox_post_sync_cmd(adapter_t *adapter, uint8_t raw_mbox[]) blocked_mailbox: - con_log(CL_ANN, (KERN_WARNING "megaraid: blocked mailbox\n") ); + con_log(CL_ANN, (KERN_WARNING "megaraid: blocked mailbox\n")); return -1; } @@ -3291,7 +3291,7 @@ megaraid_mbox_fire_sync_cmd(adapter_t *adapter) /* Check for interrupt line */ dword = RDOUTDOOR(raid_dev); WROUTDOOR(raid_dev, dword); - WRINDOOR(raid_dev,2); + WRINDOOR(raid_dev, 2); return status; diff --git a/drivers/scsi/megaraid/megaraid_mm.c b/drivers/scsi/megaraid/megaraid_mm.c index abf7b40..2939f0e 100644 --- a/drivers/scsi/megaraid/megaraid_mm.c +++ b/drivers/scsi/megaraid/megaraid_mm.c @@ -136,7 +136,7 @@ mraid_mm_ioctl(struct file *filep, unsigned int cmd, unsigned long arg) /* * At present, we don't support the new ioctl packet */ - if (!old_ioctl ) + if (!old_ioctl) return (-EINVAL); /* @@ -162,7 +162,7 @@ mraid_mm_ioctl(struct file *filep, unsigned int cmd, unsigned long arg) if (!adp->quiescent) { con_log(CL_ANN, (KERN_WARNING "megaraid cmm: controller cannot accept cmds due to " - "earlier errors\n" )); + "earlier errors\n")); return -EFAULT; } @@ -611,7 +611,7 @@ mraid_mm_alloc_kioc(mraid_mmadp_t *adp) kioc->buf_vaddr = NULL; kioc->buf_paddr = 0; - kioc->pool_index =-1; + kioc->pool_index = -1; kioc->free_buf = 0; kioc->user_data = NULL; kioc->user_data_len = 0; @@ -639,15 +639,15 @@ mraid_mm_dealloc_kioc(mraid_mmadp_t *adp, uioc_t *kioc) spin_lock_irqsave(&pool->lock, flags); /* - * While attaching the dma buffer, if we didn't get the - * required buffer from the pool, we would have allocated - * it at the run time and set the free_buf flag. We must - * free that buffer. Otherwise, just mark that the buffer is + * While attaching the dma buffer, if we didn't get the + * required buffer from the pool, we would have allocated + * it at the run time and set the free_buf flag. We must + * free that buffer. Otherwise, just mark that the buffer is * not in use */ if (kioc->free_buf == 1) - dma_pool_free(pool->handle, kioc->buf_vaddr, - kioc->buf_paddr); + dma_pool_free(pool->handle, kioc->buf_vaddr, + kioc->buf_paddr); else pool->in_use = 0; @@ -748,7 +748,7 @@ ioctl_done(uioc_t *kioc) adapter = NULL; adapno = kioc->adapno; - con_log(CL_ANN, ( KERN_WARNING "megaraid cmm: completed " + con_log(CL_ANN, (KERN_WARNING "megaraid cmm: completed " "ioctl that was timedout before\n")); list_for_each_entry(adapter, &adapters_list_g, list) { @@ -758,7 +758,7 @@ ioctl_done(uioc_t *kioc) kioc->timedout = 0; if (adapter) { - mraid_mm_dealloc_kioc( adapter, kioc ); + mraid_mm_dealloc_kioc(adapter, kioc); } } else { @@ -1067,7 +1067,7 @@ mraid_mm_setup_dma_pools(mraid_mmadp_t *adp) */ bufsize = MRAID_MM_INIT_BUFF_SIZE; - for (i = 0; i < MAX_DMA_POOLS; i++){ + for (i = 0; i < MAX_DMA_POOLS; i++) { pool = &adp->dma_pool_list[i]; @@ -1226,7 +1226,7 @@ mraid_mm_init(void) static void __exit mraid_mm_exit(void) { - con_log(CL_DLEVEL1 , ("exiting common mod\n")); + con_log(CL_DLEVEL1, ("exiting common mod\n")); misc_deregister(&megaraid_mm_dev); } diff --git a/drivers/scsi/megaraid/megaraid_sas_base.c b/drivers/scsi/megaraid/megaraid_sas_base.c index 4d4e9db..b2a34f7 100644 --- a/drivers/scsi/megaraid/megaraid_sas_base.c +++ b/drivers/scsi/megaraid/megaraid_sas_base.c @@ -1666,26 +1666,33 @@ static inline void megasas_dump_pending_frames(struct megasas_instance *instance) { struct megasas_cmd *cmd; - int i,n; + int i, n; union megasas_sgl *mfi_sgl; struct megasas_io_frame *ldio; struct megasas_pthru_frame *pthru; u32 sgcount; u16 max_cmd = instance->max_fw_cmds; - dev_err(&instance->pdev->dev, "[%d]: Dumping Frame Phys Address of all pending cmds in FW\n",instance->host->host_no); - dev_err(&instance->pdev->dev, "[%d]: Total OS Pending cmds : %d\n",instance->host->host_no,atomic_read(&instance->fw_outstanding)); + dev_err(&instance->pdev->dev, "[%d]: Dumping Frame Phys Address of all pending cmds in FW\n", + instance->host->host_no); + dev_err(&instance->pdev->dev, "[%d]: Total OS Pending cmds : %d\n", + instance->host->host_no, atomic_read(&instance->fw_outstanding)); if (IS_DMA64) - dev_err(&instance->pdev->dev, "[%d]: 64 bit SGLs were sent to FW\n",instance->host->host_no); + dev_err(&instance->pdev->dev, "[%d]: 64 bit SGLs were sent to FW\n", + instance->host->host_no); else - dev_err(&instance->pdev->dev, "[%d]: 32 bit SGLs were sent to FW\n",instance->host->host_no); + dev_err(&instance->pdev->dev, "[%d]: 32 bit SGLs were sent to FW\n", + instance->host->host_no); - dev_err(&instance->pdev->dev, "[%d]: Pending OS cmds in FW : \n",instance->host->host_no); + dev_err(&instance->pdev->dev, "[%d]: Pending OS cmds in FW :\n", + instance->host->host_no); for (i = 0; i < max_cmd; i++) { cmd = instance->cmd_list[i]; if (!cmd->scmd) continue; - dev_err(&instance->pdev->dev, "[%d]: Frame addr :0x%08lx : ",instance->host->host_no,(unsigned long)cmd->frame_phys_addr); + dev_err(&instance->pdev->dev, "[%d]: Frame addr :0x%08lx : ", + instance->host->host_no, + (unsigned long)cmd->frame_phys_addr); if (megasas_cmd_type(cmd->scmd) == READ_WRITE_LDIO) { ldio = (struct megasas_io_frame *)cmd->frame; mfi_sgl = &ldio->sgl; @@ -1718,7 +1725,8 @@ megasas_dump_pending_frames(struct megasas_instance *instance) } } } /*for max_cmd*/ - dev_err(&instance->pdev->dev, "[%d]: Pending Internal cmds in FW : \n",instance->host->host_no); + dev_err(&instance->pdev->dev, "[%d]: Pending Internal cmds in FW :\n", + instance->host->host_no); for (i = 0; i < max_cmd; i++) { cmd = instance->cmd_list[i]; @@ -1726,7 +1734,8 @@ megasas_dump_pending_frames(struct megasas_instance *instance) if (cmd->sync_cmd == 1) dev_err(&instance->pdev->dev, "0x%08lx : ", (unsigned long)cmd->frame_phys_addr); } - dev_err(&instance->pdev->dev, "[%d]: Dumping Done\n\n",instance->host->host_no); + dev_err(&instance->pdev->dev, "[%d]: Dumping Done\n\n", + instance->host->host_no); } u32 @@ -2779,7 +2788,7 @@ static int megasas_wait_for_outstanding(struct megasas_instance *instance) if (!(i % MEGASAS_RESET_NOTICE_INTERVAL)) { dev_notice(&instance->pdev->dev, "[%2d]waiting for %d " - "commands to complete\n",i,outstanding); + "commands to complete\n", i, outstanding); /* * Call cmd completion routine. Cmd to be * be completed directly without depending on isr. @@ -4412,7 +4421,7 @@ int megasas_alloc_cmds(struct megasas_instance *instance) return -ENOMEM; } - memset(instance->cmd_list, 0, sizeof(struct megasas_cmd *) *max_cmd); + memset(instance->cmd_list, 0, sizeof(struct megasas_cmd *) * max_cmd); for (i = 0; i < max_cmd; i++) { instance->cmd_list[i] = kmalloc(sizeof(struct megasas_cmd), @@ -6494,7 +6503,7 @@ static int megasas_init_fw(struct megasas_instance *instance) */ static void megasas_release_mfi(struct megasas_instance *instance) { - u32 reply_q_sz = sizeof(u32) *(instance->max_mfi_cmds + 1); + u32 reply_q_sz = sizeof(u32) * (instance->max_mfi_cmds + 1); if (instance->reply_queue) dma_free_coherent(&instance->pdev->dev, reply_q_sz, From patchwork Sat Apr 10 06:48:03 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: luojiaxing X-Patchwork-Id: 419098 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 25749C43461 for ; Sat, 10 Apr 2021 06:48:12 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id F3F066115A for ; Sat, 10 Apr 2021 06:48:11 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233527AbhDJGsY (ORCPT ); Sat, 10 Apr 2021 02:48:24 -0400 Received: from szxga06-in.huawei.com ([45.249.212.32]:16887 "EHLO szxga06-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234343AbhDJGsL (ORCPT ); Sat, 10 Apr 2021 02:48:11 -0400 Received: from DGGEMS411-HUB.china.huawei.com (unknown [172.30.72.58]) by szxga06-in.huawei.com (SkyGuard) with ESMTP id 4FHQWJ4dlRzkhqZ; Sat, 10 Apr 2021 14:46:04 +0800 (CST) Received: from huawei.com (10.69.192.56) by DGGEMS411-HUB.china.huawei.com (10.3.19.211) with Microsoft SMTP Server id 14.3.498.0; Sat, 10 Apr 2021 14:47:44 +0800 From: Luo Jiaxing To: , , , , CC: , , , , Subject: [PATCH v1 4/8] scsi: megaraid: clean up for open/close brace Date: Sat, 10 Apr 2021 14:48:03 +0800 Message-ID: <1618037287-460-5-git-send-email-luojiaxing@huawei.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1618037287-460-1-git-send-email-luojiaxing@huawei.com> References: <1618037287-460-1-git-send-email-luojiaxing@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.69.192.56] X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org There are few kinds of error about open/close brace is reported by checkpatch.pl: ERROR: open brace '{' following function definitions go on the next line int megasas_sync_pd_seq_num(struct megasas_instance *instance, bool pend) { ERROR: else should follow close brace '}' + } + else So fix them all. Signed-off-by: Jianqin Xie Signed-off-by: Luo Jiaxing --- drivers/scsi/megaraid/megaraid_mbox.c | 57 ++++++++++------------------- drivers/scsi/megaraid/megaraid_mm.c | 10 ++--- drivers/scsi/megaraid/megaraid_sas_base.c | 7 ++-- drivers/scsi/megaraid/megaraid_sas_fusion.c | 11 +++--- 4 files changed, 31 insertions(+), 54 deletions(-) diff --git a/drivers/scsi/megaraid/megaraid_mbox.c b/drivers/scsi/megaraid/megaraid_mbox.c index 6d76b15..d3fcaca 100644 --- a/drivers/scsi/megaraid/megaraid_mbox.c +++ b/drivers/scsi/megaraid/megaraid_mbox.c @@ -537,8 +537,7 @@ megaraid_detach_one(struct pci_dev *pdev) pdev->subsystem_device)); return; - } - else { + } else { con_log(CL_ANN, (KERN_NOTICE "megaraid: detaching device %#4.04x:%#4.04x:%#4.04x:%#4.04x\n", pdev->vendor, pdev->device, pdev->subsystem_vendor, @@ -1545,8 +1544,7 @@ megaraid_mbox_build_cmd(adapter_t *adapter, struct scsi_cmnd *scp, int *busy) vaddr = (caddr_t) sg_virt(&sgl[0]); memset(vaddr, 0, scp->cmnd[4]); - } - else { + } else { con_log(CL_ANN, (KERN_WARNING "megaraid mailbox: invalid sg:%d\n", __LINE__)); @@ -1705,8 +1703,7 @@ megaraid_mbox_build_cmd(adapter_t *adapter, struct scsi_cmnd *scp, int *busy) ((uint32_t)scp->cmnd[7] << 16) | ((uint32_t)scp->cmnd[8] << 8) | (uint32_t)scp->cmnd[9]; - } - else { + } else { con_log(CL_ANN, (KERN_WARNING "megaraid: unsupported CDB length\n")); @@ -1762,8 +1759,7 @@ megaraid_mbox_build_cmd(adapter_t *adapter, struct scsi_cmnd *scp, int *busy) scp->result = (DID_BAD_TARGET << 16); return NULL; } - } - else { // Passthru device commands + } else { // Passthru device commands // Do not allow access to target id > 15 or LUN > 7 if (target > 15 || SCP2LUN(scp) > 7) { @@ -1830,8 +1826,7 @@ megaraid_mbox_build_cmd(adapter_t *adapter, struct scsi_cmnd *scp, int *busy) mbox64->xferaddr_lo = (uint32_t)ccb->epthru_dma_h; mbox64->xferaddr_hi = 0; mbox->xferaddr = 0xFFFFFFFF; - } - else { + } else { mbox->cmd = MBOXCMD_PASSTHRU64; megaraid_mbox_prepare_pthru(adapter, scb, scp); @@ -1961,8 +1956,7 @@ megaraid_mbox_prepare_pthru(adapter_t *adapter, scb_t *scb, pthru->dataxferlen = scsi_bufflen(scp); pthru->dataxferaddr = ccb->sgl_dma_h; pthru->numsge = megaraid_mbox_mksgl(adapter, scb); - } - else { + } else { pthru->dataxferaddr = 0; pthru->dataxferlen = 0; pthru->numsge = 0; @@ -2010,8 +2004,7 @@ megaraid_mbox_prepare_epthru(adapter_t *adapter, scb_t *scb, epthru->dataxferlen = scsi_bufflen(scp); epthru->dataxferaddr = ccb->sgl_dma_h; epthru->numsge = megaraid_mbox_mksgl(adapter, scb); - } - else { + } else { epthru->dataxferaddr = 0; epthru->dataxferlen = 0; epthru->numsge = 0; @@ -2100,8 +2093,7 @@ megaraid_ack_sequence(adapter_t *adapter) // a cmm command scb = adapter->uscb_list + (completed[i] - MBOX_MAX_SCSI_CMDS); - } - else { + } else { // an os command scb = adapter->kscb_list + completed[i]; } @@ -2303,8 +2295,7 @@ megaraid_mbox_dpc(unsigned long devp) scp->result = DRIVER_SENSE << 24 | DID_OK << 16 | CHECK_CONDITION << 1; - } - else { + } else { if (mbox->cmd == MBOXCMD_EXTPTHRU) { memcpy(scp->sense_buffer, @@ -2335,8 +2326,7 @@ megaraid_mbox_dpc(unsigned long devp) if (scp->cmnd[0] == TEST_UNIT_READY) { scp->result = DID_ERROR << 16 | RESERVATION_CONFLICT << 1; - } - else + } else /* * Error code returned is 1 if Reserve or Release * failed or the input parameter is invalid @@ -2346,8 +2336,7 @@ megaraid_mbox_dpc(unsigned long devp) scp->result = DID_ERROR << 16 | RESERVATION_CONFLICT << 1; - } - else { + } else { scp->result = DID_BAD_TARGET << 16 | status; } } @@ -2485,8 +2474,7 @@ megaraid_abort_handler(struct scsi_cmnd *scp) "megaraid abort: %d[%d:%d], invalid state\n", scb->sno, scb->dev_channel, scb->dev_target)); BUG(); - } - else { + } else { con_log(CL_ANN, (KERN_WARNING "megaraid abort: %d[%d:%d], fw owner\n", scb->sno, scb->dev_channel, scb->dev_target)); @@ -2621,8 +2609,7 @@ megaraid_reset_handler(struct scsi_cmnd *scp) rval = FAILED; goto out; - } - else { + } else { con_log(CL_ANN, (KERN_NOTICE "megaraid mbox: reset sequence completed successfully\n")); } @@ -2642,8 +2629,7 @@ megaraid_reset_handler(struct scsi_cmnd *scp) if (mbox_post_sync_cmd_fast(adapter, raw_mbox) == 0) { con_log(CL_ANN, (KERN_INFO "megaraid: reservation reset\n")); - } - else { + } else { rval = FAILED; con_log(CL_ANN, (KERN_WARNING "megaraid: reservation reset failed\n")); @@ -3147,8 +3133,7 @@ megaraid_mbox_get_max_sg(adapter_t *adapter) // Issue the command if (mbox_post_sync_cmd(adapter, raw_mbox) == 0) { nsg = *(uint8_t *)adapter->ibuf; - } - else { + } else { nsg = MBOX_DEFAULT_SG_SIZE; } @@ -3940,21 +3925,18 @@ megaraid_sysfs_get_ldmap(adapter_t *adapter) "megaraid: sysfs get ld map timed out\n")); rval = -ETIME; - } - else { + } else { rval = mbox->status; } if (rval == 0) { memcpy(raid_dev->curr_ldmap, ldmap, sizeof(raid_dev->curr_ldmap)); - } - else { + } else { con_log(CL_ANN, (KERN_NOTICE "megaraid: get ld map failed with %x\n", rval)); } - } - else { + } else { con_log(CL_ANN, (KERN_NOTICE "megaraid: could not issue ldmap command:%x\n", rval)); } @@ -4050,8 +4032,7 @@ megaraid_sysfs_show_ldnum(struct device *dev, struct device_attribute *attr, cha break; } } - } - else { + } else { con_log(CL_ANN, (KERN_NOTICE "megaraid: sysfs get ld map failed: %x\n", rval)); diff --git a/drivers/scsi/megaraid/megaraid_mm.c b/drivers/scsi/megaraid/megaraid_mm.c index 2939f0e..864cbb6 100644 --- a/drivers/scsi/megaraid/megaraid_mm.c +++ b/drivers/scsi/megaraid/megaraid_mm.c @@ -390,8 +390,7 @@ mimd_to_kioc(mimd_t __user *umimd, mraid_mmadp_t *adp, uioc_t *kioc) if (mraid_mm_attach_buf(adp, kioc, kioc->xferlen)) return (-ENOMEM); - } - else { + } else { con_log(CL_ANN, (KERN_WARNING "megaraid cmm: Invalid subop\n")); return (-EINVAL); @@ -539,8 +538,7 @@ mraid_mm_attach_buf(mraid_mmadp_t *adp, uioc_t *kioc, int xferlen) spin_unlock_irqrestore(&pool->lock, flags); return 0; - } - else { + } else { spin_unlock_irqrestore(&pool->lock, flags); continue; } @@ -760,10 +758,8 @@ ioctl_done(uioc_t *kioc) if (adapter) { mraid_mm_dealloc_kioc(adapter, kioc); } - } - else { + } else wake_up(&wait_q); - } } diff --git a/drivers/scsi/megaraid/megaraid_sas_base.c b/drivers/scsi/megaraid/megaraid_sas_base.c index 7ff5820..40c77bb 100644 --- a/drivers/scsi/megaraid/megaraid_sas_base.c +++ b/drivers/scsi/megaraid/megaraid_sas_base.c @@ -3199,8 +3199,7 @@ megasas_service_aen(struct megasas_instance *instance, struct megasas_cmd *cmd) spin_unlock_irqrestore(&poll_aen_lock, flags); wake_up(&megasas_poll_wait); kill_fasync(&megasas_async_queue, SIGIO, POLL_IN); - } - else + } else cmd->abort_aen = 0; instance->aen_cmd = NULL; @@ -5686,8 +5685,8 @@ megasas_setup_irqs_msix(struct megasas_instance *instance, u8 is_probe) * return: void */ static void -megasas_destroy_irqs(struct megasas_instance *instance) { - +megasas_destroy_irqs(struct megasas_instance *instance) +{ int i; int count; struct megasas_irq_context *irq_ctx; diff --git a/drivers/scsi/megaraid/megaraid_sas_fusion.c b/drivers/scsi/megaraid/megaraid_sas_fusion.c index 7d10448..4591262 100644 --- a/drivers/scsi/megaraid/megaraid_sas_fusion.c +++ b/drivers/scsi/megaraid/megaraid_sas_fusion.c @@ -908,8 +908,8 @@ megasas_alloc_rdpq_fusion(struct megasas_instance *instance) } static void -megasas_free_rdpq_fusion(struct megasas_instance *instance) { - +megasas_free_rdpq_fusion(struct megasas_instance *instance) +{ int i; struct fusion_context *fusion; @@ -932,8 +932,8 @@ megasas_free_rdpq_fusion(struct megasas_instance *instance) { } static void -megasas_free_reply_fusion(struct megasas_instance *instance) { - +megasas_free_reply_fusion(struct megasas_instance *instance) +{ struct fusion_context *fusion; fusion = instance->ctrl_context; @@ -1296,7 +1296,8 @@ megasas_ioc_init_fusion(struct megasas_instance *instance) * issue and receive command. */ int -megasas_sync_pd_seq_num(struct megasas_instance *instance, bool pend) { +megasas_sync_pd_seq_num(struct megasas_instance *instance, bool pend) +{ int ret = 0; size_t pd_seq_map_sz; struct megasas_cmd *cmd; From patchwork Sat Apr 10 06:48:04 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: luojiaxing X-Patchwork-Id: 419101 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 534CAC433B4 for ; Sat, 10 Apr 2021 06:47:58 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 1741B610E5 for ; Sat, 10 Apr 2021 06:47:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234334AbhDJGsK (ORCPT ); Sat, 10 Apr 2021 02:48:10 -0400 Received: from szxga06-in.huawei.com ([45.249.212.32]:16883 "EHLO szxga06-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233527AbhDJGsJ (ORCPT ); Sat, 10 Apr 2021 02:48:09 -0400 Received: from DGGEMS411-HUB.china.huawei.com (unknown [172.30.72.58]) by szxga06-in.huawei.com (SkyGuard) with ESMTP id 4FHQWJ5KSGzkhsB; Sat, 10 Apr 2021 14:46:04 +0800 (CST) Received: from huawei.com (10.69.192.56) by DGGEMS411-HUB.china.huawei.com (10.3.19.211) with Microsoft SMTP Server id 14.3.498.0; Sat, 10 Apr 2021 14:47:45 +0800 From: Luo Jiaxing To: , , , , CC: , , , , Subject: [PATCH v1 5/8] scsi: megaraid: clean up for "foo * bar" Date: Sat, 10 Apr 2021 14:48:04 +0800 Message-ID: <1618037287-460-6-git-send-email-luojiaxing@huawei.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1618037287-460-1-git-send-email-luojiaxing@huawei.com> References: <1618037287-460-1-git-send-email-luojiaxing@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.69.192.56] X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org Following error is reported by checkpatch.pl: "foo * bar" should be "foo *bar" + struct megasas_iocpacket __user * user_ioc, The format of the pointer variable must be "foo *bar", so fix them. Signed-off-by: Luo Jiaxing --- drivers/scsi/megaraid/megaraid_ioctl.h | 4 ++-- drivers/scsi/megaraid/megaraid_mbox.h | 2 +- drivers/scsi/megaraid/megaraid_mm.c | 4 ++-- drivers/scsi/megaraid/megaraid_sas_base.c | 4 ++-- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/drivers/scsi/megaraid/megaraid_ioctl.h b/drivers/scsi/megaraid/megaraid_ioctl.h index 87b880fe..9bc0250 100644 --- a/drivers/scsi/megaraid/megaraid_ioctl.h +++ b/drivers/scsi/megaraid/megaraid_ioctl.h @@ -126,7 +126,7 @@ typedef struct uioc { uint8_t reserved[128]; /* Driver Data: */ - void __user * user_data; + void __user *user_data; uint32_t user_data_len; /* 64bit alignment */ @@ -138,7 +138,7 @@ typedef struct uioc { dma_addr_t pthru32_h; struct list_head list; - void (*done)(struct uioc*); + void (*done)(struct uioc *); caddr_t buf_vaddr; dma_addr_t buf_paddr; diff --git a/drivers/scsi/megaraid/megaraid_mbox.h b/drivers/scsi/megaraid/megaraid_mbox.h index d2fe7f6..3c16d38 100644 --- a/drivers/scsi/megaraid/megaraid_mbox.h +++ b/drivers/scsi/megaraid/megaraid_mbox.h @@ -189,7 +189,7 @@ typedef struct { dma_addr_t mbox_dma; spinlock_t mailbox_lock; unsigned long baseport; - void __iomem * baseaddr; + void __iomem *baseaddr; struct mraid_pci_blk mbox_pool[MBOX_MAX_SCSI_CMDS]; struct dma_pool *mbox_pool_handle; struct mraid_pci_blk epthru_pool[MBOX_MAX_SCSI_CMDS]; diff --git a/drivers/scsi/megaraid/megaraid_mm.c b/drivers/scsi/megaraid/megaraid_mm.c index 864cbb6..234885c 100644 --- a/drivers/scsi/megaraid/megaraid_mm.c +++ b/drivers/scsi/megaraid/megaraid_mm.c @@ -582,7 +582,7 @@ static uioc_t * mraid_mm_alloc_kioc(mraid_mmadp_t *adp) { uioc_t *kioc; - struct list_head* head; + struct list_head *head; unsigned long flags; down(&adp->kioc_semaphore); @@ -722,7 +722,7 @@ ioctl_done(uioc_t *kioc) { uint32_t adapno; int iterator; - mraid_mmadp_t* adapter; + mraid_mmadp_t *adapter; /* * When the kioc returns from driver, make sure it still doesn't diff --git a/drivers/scsi/megaraid/megaraid_sas_base.c b/drivers/scsi/megaraid/megaraid_sas_base.c index 40c77bb..2b17529 100644 --- a/drivers/scsi/megaraid/megaraid_sas_base.c +++ b/drivers/scsi/megaraid/megaraid_sas_base.c @@ -4402,7 +4402,7 @@ int megasas_alloc_cmds(struct megasas_instance *instance) * Allocate the dynamic array first and then allocate individual * commands. */ - instance->cmd_list = kcalloc(max_cmd, sizeof(struct megasas_cmd*), GFP_KERNEL); + instance->cmd_list = kcalloc(max_cmd, sizeof(struct megasas_cmd *), GFP_KERNEL); if (!instance->cmd_list) { dev_printk(KERN_DEBUG, &instance->pdev->dev, "out of memory\n"); @@ -8150,7 +8150,7 @@ static int megasas_set_crash_dump_params_ioctl(struct megasas_cmd *cmd) */ static int megasas_mgmt_fw_ioctl(struct megasas_instance *instance, - struct megasas_iocpacket __user * user_ioc, + struct megasas_iocpacket __user *user_ioc, struct megasas_iocpacket *ioc) { struct megasas_sge64 *kern_sge64 = NULL;