lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Fri, 23 Aug 2019 16:08:20 +0200
From:   Christophe JAILLET <christophe.jaillet@...adoo.fr>
To:     Markus Elfring <Markus.Elfring@....de>, netdev@...r.kernel.org,
        linux-arm-kernel@...ts.infradead.org,
        linux-stm32@...md-mailman.stormreply.com,
        intel-wired-lan@...ts.osuosl.org,
        bcm-kernel-feedback-list@...adcom.com,
        UNGLinuxDriver@...rochip.com,
        Alexandre Torgue <alexandre.torgue@...com>,
        Alexios Zavras <alexios.zavras@...el.com>,
        Allison Randal <allison@...utok.net>,
        Bryan Whitehead <bryan.whitehead@...rochip.com>,
        Claudiu Manoil <claudiu.manoil@....com>,
        "David S. Miller" <davem@...emloft.net>,
        Doug Berger <opendmb@...il.com>,
        Douglas Miller <dougmill@...ux.ibm.com>,
        Florian Fainelli <f.fainelli@...il.com>,
        Giuseppe Cavallaro <peppe.cavallaro@...com>,
        Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
        Jeff Kirsher <jeffrey.t.kirsher@...el.com>,
        Jilayne Lovejoy <opensource@...ayne.com>,
        Jonathan Lemon <jonathan.lemon@...il.com>,
        Jose Abreu <joabreu@...opsys.com>,
        Kate Stewart <kstewart@...uxfoundation.org>
Cc:     kernel-janitors@...r.kernel.org,
        LKML <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] ethernet: Delete unnecessary checks before the macro call “dev_kfree_skb”

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);

Powered by blists - more mailing lists