All of lore.kernel.org
 help / color / mirror / Atom feed
From: Russell King <rmk+kernel@arm.linux.org.uk>
To: "David S. Miller" <davem@davemloft.net>
Cc: netdev@vger.kernel.org, linux-arm-kernel@lists.infradead.org
Subject: [PATCH A 08/12] net: fec: remove useless fep->opened
Date: Tue, 08 Jul 2014 00:23:09 +0100	[thread overview]
Message-ID: <E1X4IFZ-0004x9-OM@rmk-PC.arm.linux.org.uk> (raw)
In-Reply-To: <20140707232148.GG21766@n2100.arm.linux.org.uk>

napi_disable() waits until the NAPI processing has completed, and then
prevents any further polls.  At this point, the driver then clears
fep->opened.  The NAPI poll function uses this to stop processing in
the receive path.  Hence, it will never see this variable cleared,
because the NAPI poll has to complete before it will be cleared.

Therefore, this variable serves no purpose, so let's remove it.

Acked-by: Fugang Duan <B38611@freescale.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
---
 drivers/net/ethernet/freescale/fec.h      | 1 -
 drivers/net/ethernet/freescale/fec_main.c | 5 -----
 2 files changed, 6 deletions(-)

diff --git a/drivers/net/ethernet/freescale/fec.h b/drivers/net/ethernet/freescale/fec.h
index 671d080105a7..96d2a18f1b99 100644
--- a/drivers/net/ethernet/freescale/fec.h
+++ b/drivers/net/ethernet/freescale/fec.h
@@ -308,7 +308,6 @@ struct fec_enet_private {
 
 	struct	platform_device *pdev;
 
-	int	opened;
 	int	dev_id;
 
 	/* Phylib and MDIO interface */
diff --git a/drivers/net/ethernet/freescale/fec_main.c b/drivers/net/ethernet/freescale/fec_main.c
index e0a1ac1826b7..309aa2ff8cc9 100644
--- a/drivers/net/ethernet/freescale/fec_main.c
+++ b/drivers/net/ethernet/freescale/fec_main.c
@@ -1215,9 +1215,6 @@ fec_enet_rx(struct net_device *ndev, int budget)
 		if ((status & BD_ENET_RX_LAST) == 0)
 			netdev_err(ndev, "rcv is not +last\n");
 
-		if (!fep->opened)
-			goto rx_processing_done;
-
 		/* Check for errors. */
 		if (status & (BD_ENET_RX_LG | BD_ENET_RX_SH | BD_ENET_RX_NO |
 			   BD_ENET_RX_CR | BD_ENET_RX_OV)) {
@@ -2172,7 +2169,6 @@ fec_enet_open(struct net_device *ndev)
 	napi_enable(&fep->napi);
 	phy_start(fep->phy_dev);
 	netif_start_queue(ndev);
-	fep->opened = 1;
 	return 0;
 }
 
@@ -2185,7 +2181,6 @@ fec_enet_close(struct net_device *ndev)
 
 	/* Don't know what to do yet. */
 	napi_disable(&fep->napi);
-	fep->opened = 0;
 	netif_tx_disable(ndev);
 	fec_stop(ndev);
 
-- 
1.8.3.1

WARNING: multiple messages have this Message-ID (diff)
From: rmk+kernel@arm.linux.org.uk (Russell King)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH A 08/12] net: fec: remove useless fep->opened
Date: Tue, 08 Jul 2014 00:23:09 +0100	[thread overview]
Message-ID: <E1X4IFZ-0004x9-OM@rmk-PC.arm.linux.org.uk> (raw)
In-Reply-To: <20140707232148.GG21766@n2100.arm.linux.org.uk>

napi_disable() waits until the NAPI processing has completed, and then
prevents any further polls.  At this point, the driver then clears
fep->opened.  The NAPI poll function uses this to stop processing in
the receive path.  Hence, it will never see this variable cleared,
because the NAPI poll has to complete before it will be cleared.

Therefore, this variable serves no purpose, so let's remove it.

Acked-by: Fugang Duan <B38611@freescale.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
---
 drivers/net/ethernet/freescale/fec.h      | 1 -
 drivers/net/ethernet/freescale/fec_main.c | 5 -----
 2 files changed, 6 deletions(-)

diff --git a/drivers/net/ethernet/freescale/fec.h b/drivers/net/ethernet/freescale/fec.h
index 671d080105a7..96d2a18f1b99 100644
--- a/drivers/net/ethernet/freescale/fec.h
+++ b/drivers/net/ethernet/freescale/fec.h
@@ -308,7 +308,6 @@ struct fec_enet_private {
 
 	struct	platform_device *pdev;
 
-	int	opened;
 	int	dev_id;
 
 	/* Phylib and MDIO interface */
diff --git a/drivers/net/ethernet/freescale/fec_main.c b/drivers/net/ethernet/freescale/fec_main.c
index e0a1ac1826b7..309aa2ff8cc9 100644
--- a/drivers/net/ethernet/freescale/fec_main.c
+++ b/drivers/net/ethernet/freescale/fec_main.c
@@ -1215,9 +1215,6 @@ fec_enet_rx(struct net_device *ndev, int budget)
 		if ((status & BD_ENET_RX_LAST) == 0)
 			netdev_err(ndev, "rcv is not +last\n");
 
-		if (!fep->opened)
-			goto rx_processing_done;
-
 		/* Check for errors. */
 		if (status & (BD_ENET_RX_LG | BD_ENET_RX_SH | BD_ENET_RX_NO |
 			   BD_ENET_RX_CR | BD_ENET_RX_OV)) {
@@ -2172,7 +2169,6 @@ fec_enet_open(struct net_device *ndev)
 	napi_enable(&fep->napi);
 	phy_start(fep->phy_dev);
 	netif_start_queue(ndev);
-	fep->opened = 1;
 	return 0;
 }
 
@@ -2185,7 +2181,6 @@ fec_enet_close(struct net_device *ndev)
 
 	/* Don't know what to do yet. */
 	napi_disable(&fep->napi);
-	fep->opened = 0;
 	netif_tx_disable(ndev);
 	fec_stop(ndev);
 
-- 
1.8.3.1

  parent reply	other threads:[~2014-07-07 23:23 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-07-07 23:21 [PATCH A 00/12] Freescale ethernet driver updates Russell King - ARM Linux
2014-07-07 23:21 ` Russell King - ARM Linux
2014-07-07 23:22 ` [PATCH A 01/12] net: fec: iMX6 FEC does not support half-duplex gigabit Russell King
2014-07-07 23:22   ` Russell King
2014-07-08 16:52   ` Sergei Shtylyov
2014-07-08 16:52     ` Sergei Shtylyov
2014-07-07 23:22 ` [PATCH A 02/12] net: fec: fix ethtool set_pauseparam duplex bug Russell King
2014-07-07 23:22   ` Russell King
2014-07-07 23:22 ` [PATCH A 03/12] net: fec: fix interrupt handling races Russell King
2014-07-07 23:22   ` Russell King
2014-07-07 23:22 ` [PATCH A 04/12] net: fec: use netif_tx_disable() rather than netif_stop_queue() Russell King
2014-07-07 23:22   ` Russell King
2014-07-07 23:22 ` [PATCH A 05/12] net: fec: remove checking for NULL phy_dev in fec_enet_close() Russell King
2014-07-07 23:22   ` Russell King
2014-07-07 23:22 ` [PATCH A 06/12] net: fec: ensure that a disconnected phy isn't configured Russell King
2014-07-07 23:22   ` Russell King
2014-07-07 23:23 ` [PATCH A 07/12] net: fec: stop the phy before shutting down the MAC Russell King
2014-07-07 23:23   ` Russell King
2014-07-07 23:23 ` Russell King [this message]
2014-07-07 23:23   ` [PATCH A 08/12] net: fec: remove useless fep->opened Russell King
2014-07-07 23:23 ` [PATCH A 09/12] net: fec: make rx skb handling more robust Russell King
2014-07-07 23:23   ` Russell King
2014-07-07 23:23 ` [PATCH A 10/12] net: fec: clean up transmit descriptor setup Russell King
2014-07-07 23:23   ` Russell King
2014-07-07 23:23 ` [PATCH A 11/12] net: fec: ensure fec_enet_free_buffers() properly cleans the rings Russell King
2014-07-07 23:23   ` Russell King
2014-07-07 23:23 ` [PATCH A 12/12] net: fec: fix missing kmalloc() failure check in fec_enet_alloc_buffers() Russell King
2014-07-07 23:23   ` Russell King
2014-07-08  4:22 ` [PATCH A 00/12] Freescale ethernet driver updates David Miller
2014-07-08  4:22   ` David Miller

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=E1X4IFZ-0004x9-OM@rmk-PC.arm.linux.org.uk \
    --to=rmk+kernel@arm.linux.org.uk \
    --cc=davem@davemloft.net \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=netdev@vger.kernel.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.