Received: by 2002:a05:6a10:1a4d:0:0:0:0 with SMTP id nk13csp208329pxb; Mon, 7 Feb 2022 09:26:03 -0800 (PST) X-Google-Smtp-Source: ABdhPJxYGOmrSZHUqTiC/4GfDjD01NP/lCJ4Z0o+TYrD3JrxwSQ4uULavdHUj4ouGvJyHDB+rg3u X-Received: by 2002:a17:906:9945:: with SMTP id zm5mr557715ejb.543.1644254763655; Mon, 07 Feb 2022 09:26:03 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1644254763; cv=none; d=google.com; s=arc-20160816; b=PVvllI5PhVsRY9t1AACRjqSGySpXOGVOv0EQgoI1/0uCJnTXZnBzWO/RaDMCnLXnC3 YkghJTsLtnYF0kJD9J46+8qz0HwiB0aKJIzv+0VEFKYQmLYsh6MjlTo3Awc68gCXGPEG rcdr2Fsva4iMMP+bqNZmHHjfMna4s4JthDJ6VtQzC5o5pruyqOD+J6Mcb2DG//zJTGt2 F0A6j/LaqicP5Hrgo1LD+M4AgNLexyjfn6JALeGo2nF4rjA+0hggFSsETebFa07QiWYi NwKodtOvP8Xa6wbIoB7IKXsZD9mKp5rTHFXODD8K5QWG3wvMEZhmKsYIYdEwjdidCSSn +x/w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=1XwflmxXqaw1h9FUmRE9h1jSPEvbihy8yzDC91ESbUc=; b=MRjm6yIHhErvVKze8gZM4mqwknf6VFHPDE7fOgPxbvVhqhwlkswe8NWEwxtqLU5SSR rmrCi5lfiL/cBrK9kw+PTArnWU3idnYvX56M/WH6Sa5f4tJn7UtPEdKOIPjnb9K48QcB TtG3Oxuqfn3ATbwsMTRpsEYAm2130+7EyE9jqR5ofVobacHe0q5XOQfT2n4v6S/jBK0+ p3etGtRAtux3lnS4Fs2b/4XTj50jmFFIe13oRmSQoGW82VBdzShxblO5LlzMrRfqD8TI JHJ1tEQSPz3gj1Bg2IAx0LXMmMa0LeRBgkpWsMwpQ26TfedJxdGTTmwnJQuTcFWwp1Xm bwyA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id z10si9443816edb.206.2022.02.07.09.25.38; Mon, 07 Feb 2022 09:26:03 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236149AbiBFMz6 (ORCPT + 99 others); Sun, 6 Feb 2022 07:55:58 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59192 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235893AbiBFMzz (ORCPT ); Sun, 6 Feb 2022 07:55:55 -0500 Received: from out30-131.freemail.mail.aliyun.com (out30-131.freemail.mail.aliyun.com [115.124.30.131]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C5E68C06173B; Sun, 6 Feb 2022 04:55:53 -0800 (PST) X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R411e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=e01e04400;MF=yang.lee@linux.alibaba.com;NM=1;PH=DS;RN=7;SR=0;TI=SMTPD_---0V3gnuuW_1644152150; Received: from localhost(mailfrom:yang.lee@linux.alibaba.com fp:SMTPD_---0V3gnuuW_1644152150) by smtp.aliyun-inc.com(127.0.0.1); Sun, 06 Feb 2022 20:55:51 +0800 From: Yang Li To: jejb@linux.ibm.com Cc: martin.petersen@oracle.com, jinpu.wang@cloud.ionos.com, linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org, Yang Li , Abaci Robot Subject: [PATCH -next] scsi: pm8001: clean up some inconsistent indenting Date: Sun, 6 Feb 2022 20:55:48 +0800 Message-Id: <20220206125548.110945-1-yang.lee@linux.alibaba.com> X-Mailer: git-send-email 2.20.1.7.g153144c MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-9.9 required=5.0 tests=BAYES_00, ENV_AND_HDR_SPF_MATCH,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE,UNPARSEABLE_RELAY,USER_IN_DEF_SPF_WL autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Eliminate the follow smatch warning: drivers/scsi/pm8001/pm8001_ctl.c:760 pm8001_update_flash() warn: inconsistent indenting Reported-by: Abaci Robot Signed-off-by: Yang Li --- drivers/scsi/pm8001/pm8001_ctl.c | 65 +++++++++++++++++--------------- 1 file changed, 35 insertions(+), 30 deletions(-) diff --git a/drivers/scsi/pm8001/pm8001_ctl.c b/drivers/scsi/pm8001/pm8001_ctl.c index 41a63c9b719b..213ebf39261f 100644 --- a/drivers/scsi/pm8001/pm8001_ctl.c +++ b/drivers/scsi/pm8001/pm8001_ctl.c @@ -755,36 +755,41 @@ static int pm8001_update_flash(struct pm8001_hba_info *pm8001_ha) fwControl->retcode = 0;/* OUT */ fwControl->offset = loopNumber * IOCTL_BUF_SIZE;/*OUT */ - /* for the last chunk of data in case file size is not even with - 4k, load only the rest*/ - if (((loopcount-loopNumber) == 1) && - ((partitionSize + HEADER_LEN) % IOCTL_BUF_SIZE)) { - fwControl->len = - (partitionSize + HEADER_LEN) % IOCTL_BUF_SIZE; - memcpy((u8 *)fwControl->buffer, - (u8 *)pm8001_ha->fw_image->data + sizeRead, - (partitionSize + HEADER_LEN) % IOCTL_BUF_SIZE); - sizeRead += - (partitionSize + HEADER_LEN) % IOCTL_BUF_SIZE; - } else { - memcpy((u8 *)fwControl->buffer, - (u8 *)pm8001_ha->fw_image->data + sizeRead, - IOCTL_BUF_SIZE); - sizeRead += IOCTL_BUF_SIZE; - } - - pm8001_ha->nvmd_completion = &completion; - ret = PM8001_CHIP_DISP->fw_flash_update_req(pm8001_ha, payload); - if (ret) { - pm8001_ha->fw_status = FAIL_OUT_MEMORY; - goto out; - } - wait_for_completion(&completion); - if (fwControl->retcode > FLASH_UPDATE_IN_PROGRESS) { - pm8001_ha->fw_status = fwControl->retcode; - ret = -EFAULT; - goto out; - } + /* for the last chunk of data in case file + * size is not even with 4k, load only the rest + */ + if (((loopcount-loopNumber) == 1) && + ((partitionSize + HEADER_LEN) % IOCTL_BUF_SIZE)) { + fwControl->len = + (partitionSize + HEADER_LEN) % + IOCTL_BUF_SIZE; + memcpy((u8 *)fwControl->buffer, + (u8 *)pm8001_ha->fw_image->data + sizeRead, + (partitionSize + HEADER_LEN) % + IOCTL_BUF_SIZE); + sizeRead += + (partitionSize + HEADER_LEN) % + IOCTL_BUF_SIZE; + } else { + memcpy((u8 *)fwControl->buffer, + (u8 *)pm8001_ha->fw_image->data + sizeRead, + IOCTL_BUF_SIZE); + sizeRead += IOCTL_BUF_SIZE; + } + + pm8001_ha->nvmd_completion = &completion; + ret = PM8001_CHIP_DISP->fw_flash_update_req(pm8001_ha, + payload); + if (ret) { + pm8001_ha->fw_status = FAIL_OUT_MEMORY; + goto out; + } + wait_for_completion(&completion); + if (fwControl->retcode > FLASH_UPDATE_IN_PROGRESS) { + pm8001_ha->fw_status = fwControl->retcode; + ret = -EFAULT; + goto out; + } } } out: -- 2.20.1.7.g153144c