From patchwork Sat Nov 19 11:20:49 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christophe JAILLET X-Patchwork-Id: 23249 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp664902wrr; Sat, 19 Nov 2022 03:32:46 -0800 (PST) X-Google-Smtp-Source: AA0mqf7IoJ12ZrupCtDxHXS9XI1k2UU8yic9jH2IUEXG5OiF1UgbyMNrrzbJQT3lTrEhMpD5FT9j X-Received: by 2002:a17:907:6d12:b0:7b2:bb8c:5398 with SMTP id sa18-20020a1709076d1200b007b2bb8c5398mr600730ejc.573.1668857566064; Sat, 19 Nov 2022 03:32:46 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668857566; cv=none; d=google.com; s=arc-20160816; b=gKWY9sVKZywr+MvkRXW4nkVu1yjLtY3VZIEYUp48xs7l9Y80QkvoDp4VVsrsOhWsUG Bn2E32SESSHddMxviYNCtPeWYschsyGP6THevyHb/ehgd4Qi0JxA2Lf1mi/4rFXZPcif IrDFE0wLXH3L6EPiW8DYMubMJlbX1ErhjpLgY8VugrI+c0R+f8aL4j7Pa0VlWEtAaFeg PoDlKpn3pqtl7Ahi2ILwCXiJ2Lfefc/UKvbjWR3AhTWFXvK+EVoa046u/6FTXyBTbSac PpxrSEPl99sk42bZzhOtNTPDd8xMbdAiaAOPsnD2MCbNh6LGllNX1bEWRIdoZmksB+od c5qQ== 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=b1dnUoV219qc4rW2QsroAWaYJUwkWQbaTQQ0IomNVDg=; b=0dZ48o7dhtMGhCzzh4siIplqptgJpqBFLblSkojgDuI2ngOY9KilFQ2U6aekdazJqI +XiBVtDFJoKzoYrsXDr5W0q2g/8cHj61GYx7Z9a0zoPAU4MEeiU3gM07QXyngzbNWT/E DyIVHc6ssEXfSYJSZ+9XC8p4SRiYK5L6eXcgFMWXM13VcAQxfXtO9/ifZPxfvaql9tyh cExUKTMyvE/ehIH5Kuk+EQkcyp7JoSWBljHC3+VM3+hslxY0x+G/h19bVOx+r+yrnIuL XZ93F5Hcx9gKEE3WIq7U/XHocY/ZCOOYeMAhbttrAo/Vtp+pyyZMd+nw49DXmgvVTSXK q/7w== 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 Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id hz5-20020a1709072ce500b007832270e88fsi5069056ejc.681.2022.11.19.03.32.21; Sat, 19 Nov 2022 03:32:46 -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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231658AbiKSLU6 (ORCPT + 99 others); Sat, 19 Nov 2022 06:20:58 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49866 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231597AbiKSLUz (ORCPT ); Sat, 19 Nov 2022 06:20:55 -0500 Received: from smtp.smtpout.orange.fr (smtp-28.smtpout.orange.fr [80.12.242.28]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D1BB72B189 for ; Sat, 19 Nov 2022 03:20:54 -0800 (PST) Received: from pop-os.home ([86.243.100.34]) by smtp.orange.fr with ESMTPA id wLtyoAfds1SdMwLtyoEjpE; Sat, 19 Nov 2022 12:20:52 +0100 X-ME-Helo: pop-os.home X-ME-Auth: Y2hyaXN0b3BoZS5qYWlsbGV0QHdhbmFkb28uZnI= X-ME-Date: Sat, 19 Nov 2022 12:20:52 +0100 X-ME-IP: 86.243.100.34 From: Christophe JAILLET To: Nilesh Javali , GR-QLogic-Storage-Upstream@marvell.com, "James E.J. Bottomley" , "Martin K. Petersen" Cc: linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org, Christophe JAILLET , linux-scsi@vger.kernel.org Subject: [PATCH] scsi: qla2xxx: No need to clear memory after a dma_alloc_coherent() call Date: Sat, 19 Nov 2022 12:20:49 +0100 Message-Id: <57d6a4c0c44b9a33087d3f17a9cc245d1943d881.1668856835.git.christophe.jaillet@wanadoo.fr> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_PASS autolearn=unavailable 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?1749923991063620103?= X-GMAIL-MSGID: =?utf-8?q?1749923991063620103?= dma_alloc_coherent() already clear the allocated memory, there is no need to explicitly call memset(). Signed-off-by: Christophe JAILLET --- Compile tested only --- drivers/scsi/qla2xxx/qla_gs.c | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/drivers/scsi/qla2xxx/qla_gs.c b/drivers/scsi/qla2xxx/qla_gs.c index 64ab070b8716..0afd6cee7113 100644 --- a/drivers/scsi/qla2xxx/qla_gs.c +++ b/drivers/scsi/qla2xxx/qla_gs.c @@ -622,8 +622,7 @@ static int qla_async_rftid(scsi_qla_host_t *vha, port_id_t *d_id) __func__); goto done_free_sp; } - ct_sns = (struct ct_sns_pkt *)sp->u.iocb_cmd.u.ctarg.rsp; - memset(ct_sns, 0, sizeof(*ct_sns)); + ct_sns = (struct ct_sns_pkt *)sp->u.iocb_cmd.u.ctarg.req; /* Prepare CT request */ @@ -718,8 +717,7 @@ static int qla_async_rffid(scsi_qla_host_t *vha, port_id_t *d_id, __func__); goto done_free_sp; } - ct_sns = (struct ct_sns_pkt *)sp->u.iocb_cmd.u.ctarg.rsp; - memset(ct_sns, 0, sizeof(*ct_sns)); + ct_sns = (struct ct_sns_pkt *)sp->u.iocb_cmd.u.ctarg.req; /* Prepare CT request */ @@ -810,8 +808,7 @@ static int qla_async_rnnid(scsi_qla_host_t *vha, port_id_t *d_id, __func__); goto done_free_sp; } - ct_sns = (struct ct_sns_pkt *)sp->u.iocb_cmd.u.ctarg.rsp; - memset(ct_sns, 0, sizeof(*ct_sns)); + ct_sns = (struct ct_sns_pkt *)sp->u.iocb_cmd.u.ctarg.req; /* Prepare CT request */ @@ -917,8 +914,7 @@ static int qla_async_rsnn_nn(scsi_qla_host_t *vha) __func__); goto done_free_sp; } - ct_sns = (struct ct_sns_pkt *)sp->u.iocb_cmd.u.ctarg.rsp; - memset(ct_sns, 0, sizeof(*ct_sns)); + ct_sns = (struct ct_sns_pkt *)sp->u.iocb_cmd.u.ctarg.req; /* Prepare CT request */ @@ -3228,10 +3224,8 @@ int qla24xx_async_gpnid(scsi_qla_host_t *vha, port_id_t *id) goto done_free_sp; } - ct_sns = (struct ct_sns_pkt *)sp->u.iocb_cmd.u.ctarg.rsp; - memset(ct_sns, 0, sizeof(*ct_sns)); - ct_sns = (struct ct_sns_pkt *)sp->u.iocb_cmd.u.ctarg.req; + /* CT_IU preamble */ ct_req = qla2x00_prep_ct_req(ct_sns, GPN_ID_CMD, GPN_ID_RSP_SIZE);