netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Stephen Hemminger <stephen@networkplumber.org>
To: Stephen Hemminger <stephen@networkplumber.org>
Cc: David Miller <davem@davemloft.net>,
	Neil Horman <nhorman@tuxdriver.com>,
	Jiri Pirko <jiri@resnulli.us>, Jay Vosburgh <fubar@us.ibm.com>,
	Andy Gospodarek <andy@greyhouse.net>,
	netdev@vger.kernel.org
Subject: [PATCH 2/3 net-next] team: cleanup netpoll clode
Date: Wed, 24 Jul 2013 11:52:44 -0700	[thread overview]
Message-ID: <20130724115244.3fd7a43d@nehalam.linuxnetplumber.net> (raw)
In-Reply-To: <20130724115141.63bba894@nehalam.linuxnetplumber.net>

This started out with fixing a sparse warning, then I realized that
the wrapper function team_netpoll_info could just be collapsed away
by rolling it into the enable code.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>

--- a/drivers/net/team/team.c	2013-07-24 08:34:05.257987576 -0700
+++ b/drivers/net/team/team.c	2013-07-24 08:34:10.357931582 -0700
@@ -1037,6 +1037,9 @@ static int team_port_enable_netpoll(stru
 	struct netpoll *np;
 	int err;
 
+	if (!team->dev->npinfo)
+		return 0;
+
 	np = kzalloc(sizeof(*np), gfp);
 	if (!np)
 		return -ENOMEM;
@@ -1063,12 +1066,6 @@ static void team_port_disable_netpoll(st
 	__netpoll_cleanup(np);
 	kfree(np);
 }
-
-static struct netpoll_info *team_netpoll_info(struct team *team)
-{
-	return team->dev->npinfo;
-}
-
 #else
 static int team_port_enable_netpoll(struct team *team, struct team_port *port,
 				    gfp_t gfp)
@@ -1078,10 +1075,6 @@ static int team_port_enable_netpoll(stru
 static void team_port_disable_netpoll(struct team_port *port)
 {
 }
-static struct netpoll_info *team_netpoll_info(struct team *team)
-{
-	return NULL;
-}
 #endif
 
 static void __team_port_change_port_added(struct team_port *port, bool linkup);
@@ -1163,13 +1156,11 @@ static int team_port_add(struct team *te
 		goto err_vids_add;
 	}
 
-	if (team_netpoll_info(team)) {
-		err = team_port_enable_netpoll(team, port, GFP_KERNEL);
-		if (err) {
-			netdev_err(dev, "Failed to enable netpoll on device %s\n",
-				   portname);
-			goto err_enable_netpoll;
-		}
+	err = team_port_enable_netpoll(team, port, GFP_KERNEL);
+	if (err) {
+		netdev_err(dev, "Failed to enable netpoll on device %s\n",
+			   portname);
+		goto err_enable_netpoll;
 	}
 
 	err = netdev_master_upper_dev_link(port_dev, dev);

  reply	other threads:[~2013-07-24 18:54 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-07-24 18:51 [PATCH 1/3 net-next] bridge: cleanup netpoll code Stephen Hemminger
2013-07-24 18:52 ` Stephen Hemminger [this message]
2013-07-24 19:08   ` [PATCH 2/3 net-next] team: cleanup netpoll clode Jiri Pirko
2013-07-26 22:25   ` David Miller
2013-07-24 18:53 ` [PATCH 3/3 net-next] bond: cleanup netpoll code Stephen Hemminger
2013-07-24 19:08   ` Jiri Pirko
2013-07-25 13:06   ` Neil Horman
2013-07-26 22:25   ` David Miller
2013-07-24 19:07 ` [PATCH 1/3 net-next] bridge: " Jiri Pirko
2013-07-25 13:05 ` Neil Horman
2013-07-26 22:25 ` 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=20130724115244.3fd7a43d@nehalam.linuxnetplumber.net \
    --to=stephen@networkplumber.org \
    --cc=andy@greyhouse.net \
    --cc=davem@davemloft.net \
    --cc=fubar@us.ibm.com \
    --cc=jiri@resnulli.us \
    --cc=netdev@vger.kernel.org \
    --cc=nhorman@tuxdriver.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).