Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp4891474imu; Sat, 1 Dec 2018 05:11:17 -0800 (PST) X-Google-Smtp-Source: AFSGD/VeAJ2AmOz5VRL6RQ0dt/bVWLlMvcvGWzRi16Bn/z7/vfuZi64PvR7T1NtrdgTX8uXQksFM X-Received: by 2002:a17:902:4025:: with SMTP id b34mr9377176pld.181.1543669876930; Sat, 01 Dec 2018 05:11:16 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1543669876; cv=none; d=google.com; s=arc-20160816; b=V+k52/zAXjjA249L1awUoYlNn3bchLBF6OxLkrm1zSZGsf2nwy02r6wSP5FNii+qTx 1PvF2UV2HGoLGetG8vTeWxj9jjfRRz3EySif4n4ZRh4UEb98kS0Fm3kavuICC9iusnX4 Z0ctcrIH211QfFA7IR7T6l58Y3u5Zg2064MgZ9CWEMeRfEWsD3n8wfqeqsH4M5MmJIAu uVMJD77KY0q/C/uVAFUfnNj+BVH0e/+S63HnlAIPyWxG9Vljhf6iKDSFqUFuIR2i/OOW QutBKh68k9M1JVnu28f5jqrw4cstleXOCEY1g0RypbBF+s/wsIA/YqwYZ/4dNqcarIt4 n07g== 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=TS08+4Db/JdeYMoXNsmYFKyUqNDDPA97R96Y4c/J4zQ=; b=fxmQHvnvqR+A6hHgtwWFUl0MaIOALjMC0HDyK5fIiwo/Eqw50IXVfdZED43Anle0If 00AAuK4OZYvnSgWXL3BoiW6gNETBafsHv7qUuufVIu0t6pC4o2gQBN9AR2pUymKPikLB 3B01u6RyJxsNnhWzhrDtk+25AnSag4FEWFZyL4xVnT4LdoX5KmlysVnQwLSejFkz/gSV z870NCCwgijtVF56GCA1Q1dwCeEvwnDanS9LA6npXERndVVHxVAwf9hN505KStBMj+t5 Blysa297rxGpeb5o6hcicfEyPz8afRnRXQB8Xl7NhcHxixX+LJd91xPaj6d92Mz1rLRg x1Lg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=pCPWJIJe; 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 l7si3628888plg.390.2018.12.01.05.10.59; Sat, 01 Dec 2018 05:11:16 -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=pCPWJIJe; 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 S1726778AbeLBAWn (ORCPT + 99 others); Sat, 1 Dec 2018 19:22:43 -0500 Received: from mail-pl1-f193.google.com ([209.85.214.193]:33997 "EHLO mail-pl1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726570AbeLBAWn (ORCPT ); Sat, 1 Dec 2018 19:22:43 -0500 Received: by mail-pl1-f193.google.com with SMTP id w4so4190707plz.1; Sat, 01 Dec 2018 05:10:14 -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=TS08+4Db/JdeYMoXNsmYFKyUqNDDPA97R96Y4c/J4zQ=; b=pCPWJIJeyYWjk5yH3ETHnUUvM0ueYMbWu7ysPqDCTmOhDqZhldpnW84wQX/aniCpu9 /atIzrNYAPCO3J2jf6KW3xOUrGaXr3uitSVcbaVqpfv2VN+Fc11aStIju18thuBV8Jx8 38twF/QjItRptQuOUK7IERypGJ+9EA2I+y0j+gEJflHPDhKNhKMVjtglRlkyvdPmgdrR mQrkaBpC/WVW6lqz8njBjv3mOAmcQyqdVG4728oDTdiaP+91EYEXzNqH54Kcjq3q1Fbz qmgQiioJULO0yhnhCcpCRyH4io+L7IF7Atqvw66gqFQNvZjIY3zNLK5HDyU1Ri1tPuUR OFuA== 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=TS08+4Db/JdeYMoXNsmYFKyUqNDDPA97R96Y4c/J4zQ=; b=gLQAj+tCD7s1dv0mnNMCsZtpKomTwHRZjSjV+6kGMa2B6QrAf8gHJP1iFLHt4ngrNu HAizvx+eZQtK+xzR+hU3oTNdMVDJRTlhIdYDa/NixI+O9YBVqcdwOIVYCQwWS7a/3tpC kkvRpt/1lhFJX50T1feud2tFZK+wRYIXdqcniiN+O97w4I1c+IyT2oNVo7sJB8EPrGzZ JjDaZoB2eLc72Qb/hbk+gpP3MKLGSSVFkQZvurbkduHCeeF1ZOL1cc2+umJiTxUw2Gs/ Qsar/Pyk5zb7qCQ3HNnWfVAqEDOpD0XEuPc8IX3GpBpqyl+7gnz6i9+h6TKoouyiGf++ SQ2w== X-Gm-Message-State: AA+aEWbpmiP6kM4Jw76GB4ZyBbasFgQ4aU1TlRUqLXWmPJy75WscEu02 thJ3v3s+XBbqEmdvOofsnPFYnwK5kceUJxUpObc= X-Received: by 2002:a17:902:9f89:: with SMTP id g9mr9392302plq.214.1543669813849; Sat, 01 Dec 2018 05:10:13 -0800 (PST) MIME-Version: 1.0 References: <5bf56248.1c69fb81.21a6e.5a72@mx.google.com> In-Reply-To: <5bf56248.1c69fb81.21a6e.5a72@mx.google.com> From: Sabyasachi Gupta Date: Sat, 1 Dec 2018 18:40:02 +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 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? > --- > 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 >