Received: by 2002:a25:ca44:0:0:0:0:0 with SMTP id a65csp1606121ybg; Wed, 29 Jul 2020 20:04:05 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxTycZcsCNoFbLk3txMrCG4/3oBoZnUCSEYbJb1/xinHlteEj8n3k7RsAbZgnBQXFVUo545 X-Received: by 2002:a17:906:1986:: with SMTP id g6mr631859ejd.404.1596078245608; Wed, 29 Jul 2020 20:04:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1596078245; cv=none; d=google.com; s=arc-20160816; b=CIfrT+iE4JKQ2f+DeyQoXjKNqzViS6KsRjlwa+sfQY0JeGXPnZFWSmRH0ecTeWzZVW hfUPBlP8FGpO/eZEWz8j1NAyb4c9owEZZcFvTKEAgfPy1MYUEAuQ2TvmDj8+mqNzylCk pmyUNctoYY+TEwhTt+xcK0YgnkmCuABJBvBzxAxh6nj0TM1XxRqLxR5qlTyPqw74ci9k TCSpEjFLSrmBFDWCypmUO5Gx3429xeyVWIqLESuIPehefHEG/f4YD0Vfx/+m0Uoy9ept jDthBcf7qsGsvYIwcO/7TPK6feSAuDR+msdKIwoAefw9F7T39/0XVXZ0TbCiW6anznts 7fBw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:date:subject:cc :to:from; bh=SWjMjhEE4lVHh4pYngWkWGQl1XQ+P1eHLnXbg1XB2pI=; b=qrFbkoqOOLeUFBCsoTGJ5g244R3bueP4s/pEtbtz8REZS3vnzvbIOg9ph2qYZyTjOz 7K4Qyg85LmBYPNPTd+fy4jcU5K3UwUvBhJjfLqec4091nBqOtqzGtoGPfqMXBGH/sPD9 Ij7fTjUiDidqqCjDVZSMYK+pRH83iV/HhKal7/sAF2B0eobYvQzuA8l30Qwxgw6fEe5E 6xtf3QsCrJhOy84detRzIIiQoFK4mIZIfxFR12ZXW/0qivi+8qjWoKk+M82r4c2wYxqP 34OzAMi4naJvW81I2TPd1NX1y4nvbOK4zMqFbnBoVL/6YppAfsO2CgAXPcZ1Tie+WiR7 FCYw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id pg13si2205558ejb.681.2020.07.29.20.03.43; Wed, 29 Jul 2020 20:04:05 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728472AbgG3DCk (ORCPT + 99 others); Wed, 29 Jul 2020 23:02:40 -0400 Received: from szxga04-in.huawei.com ([45.249.212.190]:8853 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726341AbgG3DCj (ORCPT ); Wed, 29 Jul 2020 23:02:39 -0400 Received: from DGGEMS412-HUB.china.huawei.com (unknown [172.30.72.59]) by Forcepoint Email with ESMTP id 8DB13B32D8CD9ADA7F05; Thu, 30 Jul 2020 11:02:36 +0800 (CST) Received: from huawei.com (10.175.104.57) by DGGEMS412-HUB.china.huawei.com (10.3.19.212) with Microsoft SMTP Server id 14.3.487.0; Thu, 30 Jul 2020 11:02:32 +0800 From: Li Heng To: CC: , Subject: [PATCH -next] scsi: Remove superfluous memset() Date: Thu, 30 Jul 2020 11:03:55 +0800 Message-ID: <1596078235-54002-1-git-send-email-liheng40@huawei.com> X-Mailer: git-send-email 2.7.4 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.175.104.57] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Fixes coccicheck warning: ./drivers/scsi/mvsas/mv_init.c:244:11-29: WARNING: dma_alloc_coherent use in mvi -> tx already zeroes out memory, so memset is not needed ./drivers/scsi/mvsas/mv_init.c:250:15-33: WARNING: dma_alloc_coherent use in mvi -> rx_fis already zeroes out memory, so memset is not needed ./drivers/scsi/mvsas/mv_init.c:256:11-29: WARNING: dma_alloc_coherent use in mvi -> rx already zeroes out memory, so memset is not needed ./drivers/scsi/mvsas/mv_init.c:265:13-31: WARNING: dma_alloc_coherent use in mvi -> slot already zeroes out memory, so memset is not needed dma_alloc_coherent use in status already zeroes out memory, so memset is not needed Signed-off-by: Li Heng --- drivers/scsi/mvsas/mv_init.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/drivers/scsi/mvsas/mv_init.c b/drivers/scsi/mvsas/mv_init.c index 978f528..6aa2697 100644 --- a/drivers/scsi/mvsas/mv_init.c +++ b/drivers/scsi/mvsas/mv_init.c @@ -246,19 +246,16 @@ static int mvs_alloc(struct mvs_info *mvi, struct Scsi_Host *shost) &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, 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, 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; @@ -267,7 +264,6 @@ static int mvs_alloc(struct mvs_info *mvi, struct Scsi_Host *shost) &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