All of lore.kernel.org
 help / color / mirror / Atom feed
From: Shannon Nelson <snelson@pensando.io>
To: netdev@vger.kernel.org, davem@davemloft.net, kuba@kernel.org
Cc: Shannon Nelson <snelson@pensando.io>
Subject: [PATCH v2 net-next 6/8] ionic: flatten calls to ionic_lif_rx_mode
Date: Thu,  5 Nov 2020 16:12:18 -0800	[thread overview]
Message-ID: <20201106001220.68130-7-snelson@pensando.io> (raw)
In-Reply-To: <20201106001220.68130-1-snelson@pensando.io>

The _ionic_lif_rx_mode() is only used once and really doesn't
need to be broken out.

Signed-off-by: Shannon Nelson <snelson@pensando.io>
---
 .../net/ethernet/pensando/ionic/ionic_lif.c   | 38 ++++++++-----------
 1 file changed, 16 insertions(+), 22 deletions(-)

diff --git a/drivers/net/ethernet/pensando/ionic/ionic_lif.c b/drivers/net/ethernet/pensando/ionic/ionic_lif.c
index a0d26fe4cbc3..ef092ee33e59 100644
--- a/drivers/net/ethernet/pensando/ionic/ionic_lif.c
+++ b/drivers/net/ethernet/pensando/ionic/ionic_lif.c
@@ -1129,29 +1129,10 @@ static void ionic_lif_rx_mode(struct ionic_lif *lif, unsigned int rx_mode)
 		lif->rx_mode = rx_mode;
 }
 
-static void _ionic_lif_rx_mode(struct ionic_lif *lif, unsigned int rx_mode,
-			       bool from_ndo)
-{
-	struct ionic_deferred_work *work;
-
-	if (from_ndo) {
-		work = kzalloc(sizeof(*work), GFP_ATOMIC);
-		if (!work) {
-			netdev_err(lif->netdev, "%s OOM\n", __func__);
-			return;
-		}
-		work->type = IONIC_DW_TYPE_RX_MODE;
-		work->rx_mode = rx_mode;
-		netdev_dbg(lif->netdev, "deferred: rx_mode\n");
-		ionic_lif_deferred_enqueue(&lif->deferred, work);
-	} else {
-		ionic_lif_rx_mode(lif, rx_mode);
-	}
-}
-
 static void ionic_set_rx_mode(struct net_device *netdev, bool from_ndo)
 {
 	struct ionic_lif *lif = netdev_priv(netdev);
+	struct ionic_deferred_work *work;
 	unsigned int nfilters;
 	unsigned int rx_mode;
 
@@ -1197,8 +1178,21 @@ static void ionic_set_rx_mode(struct net_device *netdev, bool from_ndo)
 			rx_mode &= ~IONIC_RX_MODE_F_ALLMULTI;
 	}
 
-	if (lif->rx_mode != rx_mode)
-		_ionic_lif_rx_mode(lif, rx_mode, from_ndo);
+	if (lif->rx_mode != rx_mode) {
+		if (from_ndo) {
+			work = kzalloc(sizeof(*work), GFP_ATOMIC);
+			if (!work) {
+				netdev_err(lif->netdev, "%s OOM\n", __func__);
+				return;
+			}
+			work->type = IONIC_DW_TYPE_RX_MODE;
+			work->rx_mode = rx_mode;
+			netdev_dbg(lif->netdev, "deferred: rx_mode\n");
+			ionic_lif_deferred_enqueue(&lif->deferred, work);
+		} else {
+			ionic_lif_rx_mode(lif, rx_mode);
+		}
+	}
 }
 
 static void ionic_ndo_set_rx_mode(struct net_device *netdev)
-- 
2.17.1


  parent reply	other threads:[~2020-11-06  0:12 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-06  0:12 [PATCH v2 net-next 0/8] ionic updates Shannon Nelson
2020-11-06  0:12 ` [PATCH v2 net-next 1/8] ionic: start queues before announcing link up Shannon Nelson
2020-11-06  0:12 ` [PATCH v2 net-next 2/8] ionic: check for link after netdev registration Shannon Nelson
2020-11-06  0:12 ` [PATCH v2 net-next 3/8] ionic: add lif quiesce Shannon Nelson
2020-11-06 21:07   ` Saeed Mahameed
2020-11-06  0:12 ` [PATCH v2 net-next 4/8] ionic: batch rx buffer refilling Shannon Nelson
2020-11-06  0:12 ` [PATCH v2 net-next 5/8] ionic: use mc sync for multicast filters Shannon Nelson
2020-11-06  0:12 ` Shannon Nelson [this message]
2020-11-06 17:03   ` [PATCH v2 net-next 6/8] ionic: flatten calls to ionic_lif_rx_mode Jakub Kicinski
2020-11-06 17:17     ` Shannon Nelson
2020-11-06 21:33   ` Saeed Mahameed
2020-11-07  1:17     ` Shannon Nelson
2020-11-06  0:12 ` [PATCH v2 net-next 7/8] ionic: change set_rx_mode from_ndo to can_sleep Shannon Nelson
2020-11-06  0:12 ` [PATCH v2 net-next 8/8] ionic: useful names for booleans Shannon Nelson
2020-11-06 21:36 ` [PATCH v2 net-next 0/8] ionic updates Saeed Mahameed

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=20201106001220.68130-7-snelson@pensando.io \
    --to=snelson@pensando.io \
    --cc=davem@davemloft.net \
    --cc=kuba@kernel.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.