Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp5095992imu; Wed, 19 Dec 2018 05:37:47 -0800 (PST) X-Google-Smtp-Source: AFSGD/X7Mh5ZmgNKa7O/IE/IZjhTR2YOdEUpJyoqvlXL2fqNCAhARS7yiA7EaGG2Ehr+agpKM0pe X-Received: by 2002:a17:902:b282:: with SMTP id u2mr20670250plr.89.1545226667438; Wed, 19 Dec 2018 05:37:47 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1545226667; cv=none; d=google.com; s=arc-20160816; b=xicYrgcl5LGHgMJdT7u3ZhZYstA4tVuYR0pFZtdLBUDVPPKGCOFERTxeevO+BF0CXj 3G2aCODnXL/3KGkv4byk/aTmfR7TtmmKz6/LhVJlQtsxNxK0dcaB1p0XA5lCDwlyeylK kRCnzOzPGkYrysDYpS0PsfthM/PVWPB0QKOju8CPwKaVgmU7inq3XbjQJZMz5E4xcNcD OFZYlt8q0RR/kW27sv6cmJZsQ+U5c1CiQN/lra79cHGm/P020Ib6+9+uqNEn/MC2wvo9 0VnnavNgEnJwK10oxKbjD9rCf7p3KEwup2HBRwfTooOEBRO+CcljjLDtxhVfR0hTYYLl Lsgg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=j+Om3m/eo0lXfruqJJ7SzvrT6DnHrr9AyLqsWkyXuFk=; b=Rnm2lJI2v1DLrzWitvGVKPptZyaz6yLNAPPXQxly9uOuNOVlwBm0ZDuXrCcGRny3bN PVoo9G8svU6dqJSGcvIiLsTCVxegjAWaKuAqOEi+2DaNiFP5XLcJ+qtJ4XXmNOyLh+Yn 7jJNHrHi1UL0LW5VX7j/mm13//B5rKL9etfNWWspZVFSAhA+YNN4LY2R1L7FJ/HiIXYo qrHDVjHJBXwlym1rKL7Y9qqiCOe5zR70pmLgZeYwTc2ogheKIiaEOeYskDAIJcm8ntZa vXoKOoE+IuszybV//nwONY4qFOCZin/NronY3SHPs5J5Lzh9hNBUHnCjkGUmEjIBlEpX WwHQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=bZC7Vlb4; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b18si16171846plz.105.2018.12.19.05.37.31; Wed, 19 Dec 2018 05:37:47 -0800 (PST) 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=@gmail.com header.s=20161025 header.b=bZC7Vlb4; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729011AbeLSNTk (ORCPT + 99 others); Wed, 19 Dec 2018 08:19:40 -0500 Received: from mail-pl1-f194.google.com ([209.85.214.194]:45723 "EHLO mail-pl1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727111AbeLSNTk (ORCPT ); Wed, 19 Dec 2018 08:19:40 -0500 Received: by mail-pl1-f194.google.com with SMTP id a14so9454117plm.12; Wed, 19 Dec 2018 05:19:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=j+Om3m/eo0lXfruqJJ7SzvrT6DnHrr9AyLqsWkyXuFk=; b=bZC7Vlb4LhldqDmAKaCkEFkIRRttBwe8qd+iz/4uy5C4JS8W+zOzcgO+lh90En/QRC pLrGcfxW7U8bmlztXGevLYUD61kmelj3rglTcCgqftQZ7KyVRQZPRxv/NUbY5Q5djxA5 3O6lvRehZLCHEjaPxukm74dxdDv0PT381i6SZSmLRzP+tDtproETGf5qEKhmFAUmqJrf UJxCYjhWgkm+busBZgsfEXyolfSu+p77yzj8m6MZnRcOILO6eIrK9Tl210sOTr2WZIhE FQhLijU2QPheG7dQQ9ehK621/idImeAG3U73hA6jVcFc0ucB2ribLQfcSr0XeMEYtK2B mXJg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=j+Om3m/eo0lXfruqJJ7SzvrT6DnHrr9AyLqsWkyXuFk=; b=O8tZkZhkqKhUwcs+LKNYdCHTDAO1fVk6+IViDMOvX9yklwbUrqEZUMpKInbrZPTdFO amVYRf1eiM6UCO/gsO9gO346T6JrVi/wOmmXuwvYH2wOu4KZnMEjvB48kDwFfOHTH4Ff 8RjMiwE0PPGtEDbsAz5Dwh1yA4MQUPa2Hz+eBzIl52rs3TKoxl4SF5YyjsOpNG+bZACo ud3uMcRhvoX1OxREuXcoxwP5YpkGJJ6178Bi0Rw3F+FUJtQp7vBvOBSmoZftTBVu6ruI haI2RkLZ6w9FMlaIiqHkuMUDiMagzBbGAnzTyiXgTVBXzSLyXmeYqLFPBp1mIWij48tN mHhg== X-Gm-Message-State: AA+aEWYs02CTErA++1vAqRUO29iNb/xDDVzV2PeOvllNQjgy7pbmxmmQ gVnF84POYP9SixtM58UHbHORCbupWL9SYyU9UIs= X-Received: by 2002:a17:902:8bc6:: with SMTP id r6mr20120870plo.67.1545225579209; Wed, 19 Dec 2018 05:19:39 -0800 (PST) MIME-Version: 1.0 References: <5bf56248.1c69fb81.21a6e.5a72@mx.google.com> In-Reply-To: From: Sabyasachi Gupta Date: Wed, 19 Dec 2018 18:49:27 +0530 Message-ID: Subject: Re: [PATCH] scsi/mvsas/mv_init.c: Use dma_zalloc_coherent To: jejb@linux.vnet.ibm.com, martin.petersen@oracle.com, jthumshirn@suse.de Cc: Souptick Joarder , linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org, Brajeswar Ghosh Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, Dec 1, 2018 at 6:40 PM Sabyasachi Gupta wrote: > > On Wed, Nov 21, 2018 at 7:18 PM Sabyasachi Gupta > wrote: > > > > Replace dma_alloc_coherent + memset with dma_zalloc_coherent > > > > Signed-off-by: Sabyasachi Gupta > > Any comment on this patch? Any comment on this patch? > > > --- > > drivers/scsi/mvsas/mv_init.c | 12 ++++-------- > > 1 file changed, 4 insertions(+), 8 deletions(-) > > > > diff --git a/drivers/scsi/mvsas/mv_init.c b/drivers/scsi/mvsas/mv_init.c > > index 3ac3437..495bddb 100644 > > --- a/drivers/scsi/mvsas/mv_init.c > > +++ b/drivers/scsi/mvsas/mv_init.c > > @@ -253,33 +253,29 @@ static int mvs_alloc(struct mvs_info *mvi, struct Scsi_Host *shost) > > /* > > * alloc and init our DMA areas > > */ > > - mvi->tx = dma_alloc_coherent(mvi->dev, > > + mvi->tx = dma_zalloc_coherent(mvi->dev, > > sizeof(*mvi->tx) * MVS_CHIP_SLOT_SZ, > > &mvi->tx_dma, GFP_KERNEL); > > if (!mvi->tx) > > goto err_out; > > - memset(mvi->tx, 0, sizeof(*mvi->tx) * MVS_CHIP_SLOT_SZ); > > - mvi->rx_fis = dma_alloc_coherent(mvi->dev, MVS_RX_FISL_SZ, > > + mvi->rx_fis = dma_zalloc_coherent(mvi->dev, MVS_RX_FISL_SZ, > > &mvi->rx_fis_dma, GFP_KERNEL); > > if (!mvi->rx_fis) > > goto err_out; > > - memset(mvi->rx_fis, 0, MVS_RX_FISL_SZ); > > > > - mvi->rx = dma_alloc_coherent(mvi->dev, > > + mvi->rx = dma_zalloc_coherent(mvi->dev, > > sizeof(*mvi->rx) * (MVS_RX_RING_SZ + 1), > > &mvi->rx_dma, GFP_KERNEL); > > if (!mvi->rx) > > goto err_out; > > - memset(mvi->rx, 0, sizeof(*mvi->rx) * (MVS_RX_RING_SZ + 1)); > > mvi->rx[0] = cpu_to_le32(0xfff); > > mvi->rx_cons = 0xfff; > > > > - mvi->slot = dma_alloc_coherent(mvi->dev, > > + mvi->slot = dma_zalloc_coherent(mvi->dev, > > sizeof(*mvi->slot) * slot_nr, > > &mvi->slot_dma, GFP_KERNEL); > > if (!mvi->slot) > > goto err_out; > > - memset(mvi->slot, 0, sizeof(*mvi->slot) * slot_nr); > > > > mvi->bulk_buffer = dma_alloc_coherent(mvi->dev, > > TRASH_BUCKET_SIZE, > > -- > > 2.7.4 > >