From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-vk1-f169.google.com (mail-vk1-f169.google.com [209.85.221.169]) by dpdk.org (Postfix) with ESMTP id 913742C55 for ; Mon, 8 Apr 2019 13:35:41 +0200 (CEST) Received: by mail-vk1-f169.google.com with SMTP id s80so2923198vke.6 for ; Mon, 08 Apr 2019 04:35:41 -0700 (PDT) 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=fgSdlC86E3l3JQjlDheXQ6J/HbU9uwzSlWabyIFeXLo=; b=jp0Kg9ilxPS19WDbYCtV6vq+Q5l3W7qjbRRPzqs8yuz7fslBpfZrsrtPfz919rCUf/ gb+EKA/4OoaAYLZCR/sAuV8Qi5CCTkTqqMKBRx0kADY03flH2AKHAKE43A8/j3S2lBQO tHPN1dZzHmUUZrN/CPoUfNlQPhFcqSTR6C1wiu2+J7DEnAW/0SEnMq2BNhkouadCUHlP yafLc1lVS0AoudxEb9b8SXiXHX5vNWBytUtp7TN7giZ8szgYILeaSr4eKuwulCryNqcZ BjTJrw1IPWFLl9RROp1pGoobZr8pB0F9Ca81Q9XdOsHXSnfYbkqVn2KRqWEk4lOiNeLu oN5Q== X-Gm-Message-State: APjAAAUWe3Oxw+qL1LT9S1mTwlK75dB00aZCU/c1I7D4Rcp4rLnv0wsf rS67FXQ5EXcuX/uwin7HJNLrewPOHbEXRelfbXS1Xg== X-Google-Smtp-Source: APXvYqyVIm+7Sm+yOC4JBUp6MjvuOa9nRTGYEpI68hIbhhhgPbNUsYdTmqdYo3fysswN8vOH8P4JhG+ICDiNXuIVTDA= X-Received: by 2002:a1f:7d4e:: with SMTP id y75mr15706404vkc.53.1554723341018; Mon, 08 Apr 2019 04:35:41 -0700 (PDT) MIME-Version: 1.0 References: <1554745507-15089-1-git-send-email-g.singh@nxp.com> <1554745507-15089-6-git-send-email-g.singh@nxp.com> In-Reply-To: <1554745507-15089-6-git-send-email-g.singh@nxp.com> From: David Marchand Date: Mon, 8 Apr 2019 13:35:30 +0200 Message-ID: To: Gagandeep Singh Cc: "dev@dpdk.org" , "ferruh.yigit@intel.com" Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.15 Subject: Re: [dpdk-dev] [PATCH 05/13] net/enetc: add statistics APIs X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Apr 2019 11:35:41 -0000 On Mon, Apr 8, 2019 at 1:23 PM Gagandeep Singh wrote: > +static > +int enetc_stats_get(struct rte_eth_dev *dev, > + struct rte_eth_stats *stats) > +{ > + struct enetc_eth_hw *hw = > + ENETC_DEV_PRIVATE_TO_HW(dev->data->dev_private); > + struct enetc_hw *enetc_hw = &hw->hw; > + > + if (stats == NULL) > + return -1; > + > + memset(stats, 0, sizeof(struct rte_eth_stats)); > Both the check and the memset are unneeded. https://git.dpdk.org/dpdk/tree/lib/librte_ethdev/rte_ethdev.c?h=v19.05-rc1#n1969 -- David Marchand From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by dpdk.space (Postfix) with ESMTP id A0009A0096 for ; Mon, 8 Apr 2019 13:35:44 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id D2E7B3572; Mon, 8 Apr 2019 13:35:42 +0200 (CEST) Received: from mail-vk1-f169.google.com (mail-vk1-f169.google.com [209.85.221.169]) by dpdk.org (Postfix) with ESMTP id 913742C55 for ; Mon, 8 Apr 2019 13:35:41 +0200 (CEST) Received: by mail-vk1-f169.google.com with SMTP id s80so2923198vke.6 for ; Mon, 08 Apr 2019 04:35:41 -0700 (PDT) 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=fgSdlC86E3l3JQjlDheXQ6J/HbU9uwzSlWabyIFeXLo=; b=jp0Kg9ilxPS19WDbYCtV6vq+Q5l3W7qjbRRPzqs8yuz7fslBpfZrsrtPfz919rCUf/ gb+EKA/4OoaAYLZCR/sAuV8Qi5CCTkTqqMKBRx0kADY03flH2AKHAKE43A8/j3S2lBQO tHPN1dZzHmUUZrN/CPoUfNlQPhFcqSTR6C1wiu2+J7DEnAW/0SEnMq2BNhkouadCUHlP yafLc1lVS0AoudxEb9b8SXiXHX5vNWBytUtp7TN7giZ8szgYILeaSr4eKuwulCryNqcZ BjTJrw1IPWFLl9RROp1pGoobZr8pB0F9Ca81Q9XdOsHXSnfYbkqVn2KRqWEk4lOiNeLu oN5Q== X-Gm-Message-State: APjAAAUWe3Oxw+qL1LT9S1mTwlK75dB00aZCU/c1I7D4Rcp4rLnv0wsf rS67FXQ5EXcuX/uwin7HJNLrewPOHbEXRelfbXS1Xg== X-Google-Smtp-Source: APXvYqyVIm+7Sm+yOC4JBUp6MjvuOa9nRTGYEpI68hIbhhhgPbNUsYdTmqdYo3fysswN8vOH8P4JhG+ICDiNXuIVTDA= X-Received: by 2002:a1f:7d4e:: with SMTP id y75mr15706404vkc.53.1554723341018; Mon, 08 Apr 2019 04:35:41 -0700 (PDT) MIME-Version: 1.0 References: <1554745507-15089-1-git-send-email-g.singh@nxp.com> <1554745507-15089-6-git-send-email-g.singh@nxp.com> In-Reply-To: <1554745507-15089-6-git-send-email-g.singh@nxp.com> From: David Marchand Date: Mon, 8 Apr 2019 13:35:30 +0200 Message-ID: To: Gagandeep Singh Cc: "dev@dpdk.org" , "ferruh.yigit@intel.com" Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.15 Subject: Re: [dpdk-dev] [PATCH 05/13] net/enetc: add statistics APIs X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Message-ID: <20190408113530.jAJZHhnPnqdXTu4ecbzkv5hSDQADtT42aumnKcNCqHg@z> On Mon, Apr 8, 2019 at 1:23 PM Gagandeep Singh wrote: > +static > +int enetc_stats_get(struct rte_eth_dev *dev, > + struct rte_eth_stats *stats) > +{ > + struct enetc_eth_hw *hw = > + ENETC_DEV_PRIVATE_TO_HW(dev->data->dev_private); > + struct enetc_hw *enetc_hw = &hw->hw; > + > + if (stats == NULL) > + return -1; > + > + memset(stats, 0, sizeof(struct rte_eth_stats)); > Both the check and the memset are unneeded. https://git.dpdk.org/dpdk/tree/lib/librte_ethdev/rte_ethdev.c?h=v19.05-rc1#n1969 -- David Marchand