From patchwork Fri Nov 11 07:43:10 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Xiu Jianfeng X-Patchwork-Id: 18526 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp602096wru; Thu, 10 Nov 2022 23:52:49 -0800 (PST) X-Google-Smtp-Source: AA0mqf7gimTx1Pmo3LcsNoo8IGN5u6hWJnhbSeM8zV6absTCXSqTqYtMBa0uEM0pxnAgZM3B2hgH X-Received: by 2002:a17:906:9f0e:b0:755:6595:cd34 with SMTP id fy14-20020a1709069f0e00b007556595cd34mr1014021ejc.70.1668153169608; Thu, 10 Nov 2022 23:52:49 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668153169; cv=none; d=google.com; s=arc-20160816; b=hsmR0pFpb1siFENWVRnYZIuJv7aWJIDnJFGS2hnySwYf6qCzIZTX0Z3/t3ysz4vJQ0 znL0WZYy3iRV3zjfwNwa4OgKj4v7M8wP1dpI1nxu8/KngqB/kZLymJcZRwRYwngxRkHA ZsRsEAz+Rft1dB1yndCBaQX04OFQNInQgk+QA7mhTncwEYsnbcrjwO5TzQ2n8ki0kQA7 7xBSngPp3H0YlqjbfmaclvQe5f7HrsqwSouFfEmhsOI771uYKj93nhKn/ELXqrwwJpYt AGiRwV7UqVf5XqjbaA67prcHCnCqHSMDehKsmAtyM4pTv8CsLilZlTUfzYkJpEZEta+3 b6vA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:subject:cc:to:from; bh=djtxP7u4C5bFqv0QUpfERXstnpGa/V40nL1wo5W6j1w=; b=VqPmfeH+6z62cKnSIUIr/QCCZwtqgnrPlaN4AGBuG8IUhOPCIqgukho4KdZOnYopXf TSrb4Mp4LCBvGLtlMD+aodr/nFg07uVF/cbJnQ/18ONdJEOQMHH0D/k0Bfn5YxxjSKco 5sjtof9JKMkbBKZwu1xUdosq0sLAQcojGYoNM/iuRWc3Gm9W6c+e8JUND9K+pTxLRx6Q jUBqqtrrhQOuoEw6BPpQm2QeuqLQO/SfDTi6lgj4Am1rTOK//ZtERp6FWyBR26lElsDU 2OWOBIrUtgEZQEVSRcfFlNUxnAvoQ8qnOTx7o1yRueD9b2oIvcasAMAtSOzRwaQOfhEo DzKg== 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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id xa6-20020a170906fd8600b007a6c5a23a48si1508728ejb.551.2022.11.10.23.52.26; Thu, 10 Nov 2022 23:52:49 -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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232803AbiKKHqZ (ORCPT + 99 others); Fri, 11 Nov 2022 02:46:25 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:32828 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230043AbiKKHqX (ORCPT ); Fri, 11 Nov 2022 02:46:23 -0500 Received: from szxga01-in.huawei.com (szxga01-in.huawei.com [45.249.212.187]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A943177227; Thu, 10 Nov 2022 23:46:22 -0800 (PST) Received: from dggpeml500023.china.huawei.com (unknown [172.30.72.56]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4N7rJt3LW3zbndc; Fri, 11 Nov 2022 15:42:38 +0800 (CST) Received: from ubuntu1804.huawei.com (10.67.174.58) by dggpeml500023.china.huawei.com (7.185.36.114) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31; Fri, 11 Nov 2022 15:46:20 +0800 From: Xiu Jianfeng To: , , , CC: , Subject: [PATCH -next] scsi: lpfc: Use memset_startat() helper Date: Fri, 11 Nov 2022 15:43:10 +0800 Message-ID: <20221111074310.132125-1-xiujianfeng@huawei.com> X-Mailer: git-send-email 2.17.1 MIME-Version: 1.0 X-Originating-IP: [10.67.174.58] X-ClientProxiedBy: dggems705-chm.china.huawei.com (10.3.19.182) To dggpeml500023.china.huawei.com (7.185.36.114) X-CFilter-Loop: Reflected X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1749185377861119117?= X-GMAIL-MSGID: =?utf-8?q?1749185377861119117?= User memset_startat() helper to simplify the code, no functional changes in this patch. Signed-off-by: Xiu Jianfeng Reviewed-by: James Smart --- drivers/scsi/lpfc/lpfc_sli.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/scsi/lpfc/lpfc_sli.c b/drivers/scsi/lpfc/lpfc_sli.c index d25afc9dde14..35c9404d5e49 100644 --- a/drivers/scsi/lpfc/lpfc_sli.c +++ b/drivers/scsi/lpfc/lpfc_sli.c @@ -1373,7 +1373,6 @@ static void __lpfc_sli_release_iocbq_s4(struct lpfc_hba *phba, struct lpfc_iocbq *iocbq) { struct lpfc_sglq *sglq; - size_t start_clean = offsetof(struct lpfc_iocbq, wqe); unsigned long iflag = 0; struct lpfc_sli_ring *pring; @@ -1430,7 +1429,7 @@ __lpfc_sli_release_iocbq_s4(struct lpfc_hba *phba, struct lpfc_iocbq *iocbq) /* * Clean all volatile data fields, preserve iotag and node struct. */ - memset((char *)iocbq + start_clean, 0, sizeof(*iocbq) - start_clean); + memset_startat(iocbq, 0, wqe); iocbq->sli4_lxritag = NO_XRI; iocbq->sli4_xritag = NO_XRI; iocbq->cmd_flag &= ~(LPFC_IO_NVME | LPFC_IO_NVMET | LPFC_IO_CMF | @@ -1453,12 +1452,11 @@ __lpfc_sli_release_iocbq_s4(struct lpfc_hba *phba, struct lpfc_iocbq *iocbq) static void __lpfc_sli_release_iocbq_s3(struct lpfc_hba *phba, struct lpfc_iocbq *iocbq) { - size_t start_clean = offsetof(struct lpfc_iocbq, iocb); /* * Clean all volatile data fields, preserve iotag and node struct. */ - memset((char*)iocbq + start_clean, 0, sizeof(*iocbq) - start_clean); + memset_startat(iocbq, 0, iocb); iocbq->sli4_xritag = NO_XRI; list_add_tail(&iocbq->list, &phba->lpfc_iocb_list); }