From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 56F62C433FF for ; Tue, 13 Aug 2019 08:54:56 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 33FD02063F for ; Tue, 13 Aug 2019 08:54:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728309AbfHMIyz (ORCPT ); Tue, 13 Aug 2019 04:54:55 -0400 Received: from inva021.nxp.com ([92.121.34.21]:41584 "EHLO inva021.nxp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728189AbfHMIyy (ORCPT ); Tue, 13 Aug 2019 04:54:54 -0400 Received: from inva021.nxp.com (localhost [127.0.0.1]) by inva021.eu-rdc02.nxp.com (Postfix) with ESMTP id BE24C200784; Tue, 13 Aug 2019 10:54:52 +0200 (CEST) Received: from inva024.eu-rdc02.nxp.com (inva024.eu-rdc02.nxp.com [134.27.226.22]) by inva021.eu-rdc02.nxp.com (Postfix) with ESMTP id B210420077B; Tue, 13 Aug 2019 10:54:52 +0200 (CEST) Received: from fsr-ub1464-137.ea.freescale.net (fsr-ub1464-137.ea.freescale.net [10.171.82.114]) by inva024.eu-rdc02.nxp.com (Postfix) with ESMTP id 5DEED20629; Tue, 13 Aug 2019 10:54:52 +0200 (CEST) From: Ioana Ciornei To: gregkh@linuxfoundation.org, linux-kernel@vger.kernel.org Cc: joe@perches.com, andrew@lunn.ch, ruxandra.radulescu@nxp.com, Ioana Ciornei Subject: [PATCH v2 06/10] staging: fsl-dpaa2/ethsw: remove unnecessary memset Date: Tue, 13 Aug 2019 11:54:35 +0300 Message-Id: <1565686479-32577-7-git-send-email-ioana.ciornei@nxp.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1565686479-32577-1-git-send-email-ioana.ciornei@nxp.com> References: <1565686479-32577-1-git-send-email-ioana.ciornei@nxp.com> Reply-to: ioana.ciornei@nxp.com X-Virus-Scanned: ClamAV using ClamSMTP Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The ethtool core already zeroes the memory before calling .get_ethtool_stats() thus making the memset unnecessary. Remove it. Reported-by: Andrew Lunn Signed-off-by: Ioana Ciornei --- Changes in v2: - added Reported-by tag drivers/staging/fsl-dpaa2/ethsw/ethsw-ethtool.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/drivers/staging/fsl-dpaa2/ethsw/ethsw-ethtool.c b/drivers/staging/fsl-dpaa2/ethsw/ethsw-ethtool.c index 12e33a3a1bf1..0f9f8345e534 100644 --- a/drivers/staging/fsl-dpaa2/ethsw/ethsw-ethtool.c +++ b/drivers/staging/fsl-dpaa2/ethsw/ethsw-ethtool.c @@ -149,9 +149,6 @@ static void ethsw_ethtool_get_stats(struct net_device *netdev, struct ethsw_port_priv *port_priv = netdev_priv(netdev); int i, err; - memset(data, 0, - sizeof(u64) * ETHSW_NUM_COUNTERS); - for (i = 0; i < ETHSW_NUM_COUNTERS; i++) { err = dpsw_if_get_counter(port_priv->ethsw_data->mc_io, 0, port_priv->ethsw_data->dpsw_handle, -- 1.9.1