From: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
To: Markus Elfring <Markus.Elfring@web.de>,
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 <alexandre.torgue@st.com>,
Alexios Zavras <alexios.zavras@intel.com>,
Allison Randal <allison@lohutok.net>,
Bryan Whitehead <bryan.whitehead@microchip.com>,
Claudiu Manoil <claudiu.manoil@nxp.com>,
"David S. Miller" <davem@davemloft.net>,
Doug Berger <opendmb@gmail.com>,
Douglas Miller <dougmill@linux.ibm.com>,
Florian Fainelli <f.fainelli@gmail.com>,
Giuseppe Cavallaro <peppe.cavallaro@st.com>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Jeff Kirsher <jeffrey.t.kirsher@intel.com>,
Jilayne Lovejoy <opensource@jilayne.com>,
Jonathan Lemon <jonathan.lemon@gmail.com>,
Jose Abreu <joabreu@synopsys.com>,
Kate Stewart <kstewart@linuxfoundation.org>
Cc: kernel-janitors@vger.kernel.org, LKML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] ethernet: Delete unnecessary checks before the macro call “dev_kfree_skb”
Date: Fri, 23 Aug 2019 16:08:20 +0200 [thread overview]
Message-ID: <4ab7f2a5-f472-f462-9d4c-7c8d5237c44e@wanadoo.fr> (raw)
In-Reply-To: <af1ae1cf-4a01-5e3a-edc2-058668487137@web.de>
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);
next prev parent reply other threads:[~2019-08-23 14:08 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-08-22 18:30 [PATCH] ethernet: Delete unnecessary checks before the macro call “dev_kfree_skb” Markus Elfring
2019-08-22 23:23 ` David Miller
2019-08-23 14:08 ` Christophe JAILLET [this message]
2019-08-23 16:10 ` Scott Branden
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4ab7f2a5-f472-f462-9d4c-7c8d5237c44e@wanadoo.fr \
--to=christophe.jaillet@wanadoo.fr \
--cc=Markus.Elfring@web.de \
--cc=UNGLinuxDriver@microchip.com \
--cc=alexandre.torgue@st.com \
--cc=alexios.zavras@intel.com \
--cc=allison@lohutok.net \
--cc=bcm-kernel-feedback-list@broadcom.com \
--cc=bryan.whitehead@microchip.com \
--cc=claudiu.manoil@nxp.com \
--cc=davem@davemloft.net \
--cc=dougmill@linux.ibm.com \
--cc=f.fainelli@gmail.com \
--cc=gregkh@linuxfoundation.org \
--cc=intel-wired-lan@lists.osuosl.org \
--cc=jeffrey.t.kirsher@intel.com \
--cc=joabreu@synopsys.com \
--cc=jonathan.lemon@gmail.com \
--cc=kernel-janitors@vger.kernel.org \
--cc=kstewart@linuxfoundation.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-stm32@st-md-mailman.stormreply.com \
--cc=netdev@vger.kernel.org \
--cc=opendmb@gmail.com \
--cc=opensource@jilayne.com \
--cc=peppe.cavallaro@st.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).