Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp1261155ybl; Fri, 23 Aug 2019 16:25:39 -0700 (PDT) X-Google-Smtp-Source: APXvYqyzCw18jZ3PSCwsu0bpDpdpc15Ea5niJC54/6NXmVkZ5U3ooZ0eVeg47Whafo1i9v6d3EKX X-Received: by 2002:a17:90a:a40e:: with SMTP id y14mr7443556pjp.83.1566602739359; Fri, 23 Aug 2019 16:25:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1566602739; cv=none; d=google.com; s=arc-20160816; b=pD8XK3Q5BnMkh/yqIaVUNlUDrgXy35euQiMB65EfJ7CLdzA6ndRwKNaursx4YeFoaD 8BPTRUa+lEe16hMxbM5eSvS3svzcTKtCiWGGzo69zhH+3NYnFDyu7gspppIVBFwB8mw/ YVudDJBpLaKa5pKVhnTltLu7pAHa495j9+QpWnjX+UTsntnAJGqVHZ6pp7wLkE8F87ap YwQDPGAL/By7gjFUxHUIqUmfiJD9CQjob7tWTD8hqnxv/Xh2bUEFNpyrnih+ek7ktQcR nV3l/61hRqev7G/RVBJWr6suhH5EkroxBrtcBN2vzzEjMbBQGHEk8QoorW0eIDnRIYC9 kuMg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-language :content-transfer-encoding:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=Kj+4OuIuoRLwtCA/HdfgDqj5x/mlMv9HrK4eDkknAJg=; b=sAQc+v5rL3UNYgEc4TKlLojZVnFo1uYqmMTid6mqmh3YTXdhAlgt48xZkPBQItUQuG yUtwtH8xi8lCzjN/Deqi6AdPlU+EPlbi5zqZ33Upcb3lJDjyxwR7zvXNY1bcy+JwkK6H +W6hrLyh+4xVi5fTid2ZvQi/3+xdNyyy/2VBSGUIQU/rhmPSFMrZ1cDDrhNUxHM/XLFG wZTifJXd4EwcrnDVGmG75QYqvJgQn0QcxMGm1+mUA2UpWtky0S2XwGU6fFotsIaIUoGK PlanApQkBcisV0yxUelbNu2yr9P0rdzlxMJf4O/9vocDhgF8U7yl1TGb8tqyHrdGe0Se sMVw== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 130si3025750pgg.18.2019.08.23.16.25.24; Fri, 23 Aug 2019 16:25:39 -0700 (PDT) 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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2391169AbfHWOIj (ORCPT + 99 others); Fri, 23 Aug 2019 10:08:39 -0400 Received: from smtp03.smtpout.orange.fr ([80.12.242.125]:31071 "EHLO smtp.smtpout.orange.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2390154AbfHWOIi (ORCPT ); Fri, 23 Aug 2019 10:08:38 -0400 Received: from [192.168.1.41] ([90.126.160.115]) by mwinf5d06 with ME id se8M200092Vh0YS03e8M18; Fri, 23 Aug 2019 16:08:36 +0200 X-ME-Helo: [192.168.1.41] X-ME-Auth: Y2hyaXN0b3BoZS5qYWlsbGV0QHdhbmFkb28uZnI= X-ME-Date: Fri, 23 Aug 2019 16:08:36 +0200 X-ME-IP: 90.126.160.115 Subject: =?UTF-8?Q?Re=3a_=5bPATCH=5d_ethernet=3a_Delete_unnecessary_checks_b?= =?UTF-8?Q?efore_the_macro_call_=e2=80=9cdev=5fkfree=5fskb=e2=80=9d?= To: Markus Elfring , netdev@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-stm32@st-md-mailman.stormreply.com, intel-wired-lan@lists.osuosl.org, bcm-kernel-feedback-list@broadcom.com, UNGLinuxDriver@microchip.com, Alexandre Torgue , Alexios Zavras , Allison Randal , Bryan Whitehead , Claudiu Manoil , "David S. Miller" , Doug Berger , Douglas Miller , Florian Fainelli , Giuseppe Cavallaro , Greg Kroah-Hartman , Jeff Kirsher , Jilayne Lovejoy , Jonathan Lemon , Jose Abreu , Kate Stewart Cc: kernel-janitors@vger.kernel.org, LKML References: From: Christophe JAILLET Message-ID: <4ab7f2a5-f472-f462-9d4c-7c8d5237c44e@wanadoo.fr> Date: Fri, 23 Aug 2019 16:08:20 +0200 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, in this patch, there is one piece that looked better before. (see below) Removing the 'if (skb)' is fine, but concatening everything in one statement just to save 2 variables and a few LOC is of no use, IMHO, and the code is less readable. just my 2c. CJ diff --git a/drivers/net/ethernet/broadcom/genet/bcmgenet.c b/drivers/net/ethernet/broadcom/genet/bcmgenet.c index d3a0b614dbfa..8b19ddcdafaa 100644 --- a/drivers/net/ethernet/broadcom/genet/bcmgenet.c +++ b/drivers/net/ethernet/broadcom/genet/bcmgenet.c @@ -2515,19 +2515,14 @@ static int bcmgenet_dma_teardown(struct bcmgenet_priv *priv)  static void bcmgenet_fini_dma(struct bcmgenet_priv *priv)  {      struct netdev_queue *txq; -    struct sk_buff *skb; -    struct enet_cb *cb;      int i;      bcmgenet_fini_rx_napi(priv);      bcmgenet_fini_tx_napi(priv); -    for (i = 0; i < priv->num_tx_bds; i++) { -        cb = priv->tx_cbs + i; -        skb = bcmgenet_free_tx_cb(&priv->pdev->dev, cb); -        if (skb) -            dev_kfree_skb(skb); -    } +    for (i = 0; i < priv->num_tx_bds; i++) + dev_kfree_skb(bcmgenet_free_tx_cb(&priv->pdev->dev, +                          priv->tx_cbs + i));      for (i = 0; i < priv->hw_params->tx_queues; i++) {          txq = netdev_get_tx_queue(priv->dev, priv->tx_rings[i].queue);