Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp4524876ybb; Tue, 7 Apr 2020 09:07:21 -0700 (PDT) X-Google-Smtp-Source: APiQypLkbjaLvKU5kacOTwrlr4c9egKT9SXctqKhjroo3eJgAIhkNOsi9TCvo3hvGPgxk+PZNf6i X-Received: by 2002:a9d:6292:: with SMTP id x18mr2232670otk.241.1586275641082; Tue, 07 Apr 2020 09:07:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1586275641; cv=none; d=google.com; s=arc-20160816; b=UwfluESx7/Th0DVMFg0yTixSgpKv2p7SfB5kGvwO1DDZUI+bSJ0lXrpnMbOtJTFUma NHNxUxs2kJ1dw/dpvPNc2wKMXZKc5JMaYzVpxxPDAWGg6iNys5Ns/tpMrOpVQ1nUt0y8 4eamoaKMt/kW2QSF/7LP+bR3Yn4+Mu7G6MzAdfCgEL026a8TrN98oStEy6EJpPWtzbeR ViOHTOY3BqoCt0bRFnfrxER32p6FWgVGWYH6l5xAzpW8YTOspZ00XDRnxkuYeSa9fVYb P3MtU5TXOb1VfT4M3ll4dv9c3yjobzZH/50nl+i16SRrX66qBWYrcCasUxs34gTOJxjb nLUw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=tHTXB2WOinr1wRG8Vyx0OaI9vEXu8VBr7BjtVbg2QAc=; b=y1+r3kTIXvRs2iupoDb0bjYWJNi+7T4FiPapVmDAQDIDPfy+SsdcD8THCVPPJfdolQ eUqEJ0TxydiCgxe5YKO1hykldcXss+HeZyXHPfjERTtTaHDg7nZ1Lv+IeLHUNICBr4KC HDOPqAPzZui40llROp50yHiiohC5IW9i6iPvYFrLowVQby3TEhWOB0YGivFCObQk+IYJ hWSKYO95UtjGuCBRXv7/HXwYOfmxoosBo1+AMdn/Ip6OGdbS8MYe/guL7IqJlA5VJRr0 4mEcBEsJD85LL2QPUKLT509eB0YQy68/eG9zrNZXqGOR0ezcJa1PS3YCzlJCKl9ldGCd EaqA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmx.net header.s=badeba3b8450 header.b=Jl8BqXl7; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id u3si1474141oth.152.2020.04.07.09.06.57; Tue, 07 Apr 2020 09:07:21 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmx.net header.s=badeba3b8450 header.b=Jl8BqXl7; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727957AbgDGQCq (ORCPT + 99 others); Tue, 7 Apr 2020 12:02:46 -0400 Received: from mout.gmx.net ([212.227.17.20]:49349 "EHLO mout.gmx.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726889AbgDGQCp (ORCPT ); Tue, 7 Apr 2020 12:02:45 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1586275336; bh=MjED2rL8qFcaewF1yuTCY8oY81g21cBSfIGHWAJZhMU=; h=X-UI-Sender-Class:Date:From:To:Cc:Subject:References:In-Reply-To; b=Jl8BqXl73a3riwsYbnv+x7UmfvkDw9tKZL2TNz/DJ0vFDfMaN2+x19lbN9xx87+lC 3+ZL2kMK+WiwDySFJZjTn3TmI3NAhZWNhxh0yMPypCuDv1dcm6cPNINx9XNyuxNGul rH8nkZklPVh2RmUjRZp9o9qblbOHX95hYR+B1LCE= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from lenovo-laptop ([82.19.195.159]) by mail.gmx.com (mrgmx105 [212.227.17.174]) with ESMTPSA (Nemesis) id 1N1wll-1jB2250hY1-012FWj; Tue, 07 Apr 2020 18:02:16 +0200 Date: Tue, 7 Apr 2020 17:02:13 +0100 From: Alex Dewar To: Markus Elfring Cc: Allison Randal , Arnd Bergmann , Chaitra Basappa , Greg Kroah-Hartman , Himanshu Madhani , "James E. J. Bottomley" , "Martin K. Petersen" , Richard Fontana , Sathya Prakash , Suganath Prabu Subramani , Thomas Gleixner , linux-scsi@vger.kernel.org, aacraid@microsemi.com, MPT-FusionLinux.pdl@broadcom.com, linux-kernel@vger.kernel.org Subject: Re: [PATCH] scsi: Remove unnecessary calls to memset after dma_alloc_coherent Message-ID: <20200407160213.qh64de6ebrj7qkmx@lenovo-laptop> References: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable In-Reply-To: X-Provags-ID: V03:K1:d/rbaoVneuFo0laPsfO0MaLfxIn2+jKJUs/i7ZOLORm+LfbBtQT ESuMc1oTz+fMZ0oStoWZwfeViYqrbeO1LXx1GGgpaEVPnqsXdzsBP1CCn5fNSGlUyZljOui I7fgj9QWPd7jJBqYvNLWXFsWvl2e2GA/b/izskTEJrxpVWWfI/dvT66HeAuXqJJEoWAwBWc jebJmfW9Kw6uZBru7hWMA== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1;V03:K0:U2Pjpg2Ki7w=:xq6163nCcOwVZqGtXA1HMf 19/Gs5h+3UI36/aBiaBU1kuksy+wup06rLtbVmc5WwxmfLOYa99iZHzKR77kev6SwPaMOnf/5 gyQJ2ZHoFnzVuAkgIB4AA0Ddz+Egx6RS7JGbLkoEmd6dDu1KnS5TAEDxko2eNMA/EojMz/Rq8 nEBeKbpf0mtSuVqb5v3BM4IqKZ8IGWRUhSs7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Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, Apr 04, 2020 at 01:14:52PM +0200, Markus Elfring wrote: > > dma_alloc_coherent() now zeroes memory after allocation, so additional > > calls to memset() afterwards are unnecessary. Remove them. > > I suggest to reconsider the distribution of recipients also for this pat= ch > according to the fields =E2=80=9CCc=E2=80=9D and =E2=80=9CTo=E2=80=9D. Thanks. I'll do this in a v2/RESEND. > > > =E2=80=A6 > > +++ b/drivers/scsi/dpt_i2o.c > =E2=80=A6 > > @@ -3067,13 +3064,12 @@ static int adpt_i2o_build_sys_table(void) > > sys_tbl_len =3D sizeof(struct i2o_sys_tbl) + // Header + IOPs > > (hba_count) * sizeof(struct i2o_sys_tbl_entry); > > > > - sys_tbl =3D dma_alloc_coherent(&pHba->pDev->dev, > > - sys_tbl_len, &sys_tbl_pa, GFP_KERNEL); > > + sys_tbl =3D dma_alloc_coherent(&pHba->pDev->dev, sys_tbl_len, > > + &sys_tbl_pa, GFP_KERNEL); > > if (!sys_tbl) { > =E2=80=A6 > > +++ b/drivers/scsi/mvsas/mv_init.c > > @@ -244,28 +244,22 @@ static int mvs_alloc(struct mvs_info *mvi, struc= t Scsi_Host *shost) > =E2=80=A6 > > - mvi->slot =3D dma_alloc_coherent(mvi->dev, > > - sizeof(*mvi->slot) * slot_nr, > > + mvi->slot =3D dma_alloc_coherent(mvi->dev, sizeof(*mvi->slot) * slot= _nr, > > &mvi->slot_dma, GFP_KERNEL); > > if (!mvi->slot) > =E2=80=A6 > > +++ b/drivers/scsi/qla2xxx/qla_isr.c > > @@ -79,7 +79,7 @@ qla24xx_process_abts(struct scsi_qla_host *vha, void= *pkt) > > (uint8_t *)abts, sizeof(*abts)); > > > > rsp_els =3D dma_alloc_coherent(&ha->pdev->dev, sizeof(*rsp_els), &dm= a, > > - GFP_KERNEL); > > + GFP_KERNEL); > > if (!rsp_els) { > =E2=80=A6 > > +++ b/drivers/scsi/qla2xxx/qla_mbx.c > > @@ -4887,15 +4887,13 @@ qla25xx_set_els_cmds_supported(scsi_qla_host_t= *vha) > > "Entered %s.\n", __func__); > > > > els_cmd_map =3D dma_alloc_coherent(&ha->pdev->dev, ELS_CMD_MAP_SIZE, > > - &els_cmd_map_dma, GFP_KERNEL); > > + &els_cmd_map_dma, GFP_KERNEL); > > if (!els_cmd_map) { > =E2=80=A6 > > I find it safer to integrate such source code reformattings by > another update step which will be separated from the proposed deletion > of unwanted function calls. Good point. This whitespace was autoformatted by Coccinelle, probably due to my bad SmPL skills. Best, Alex > > Regards, > Markus