* [PATCH 1/3 net-next] bridge: cleanup netpoll code
@ 2013-07-24 18:51 Stephen Hemminger
2013-07-24 18:52 ` [PATCH 2/3 net-next] team: cleanup netpoll clode Stephen Hemminger
` (4 more replies)
0 siblings, 5 replies; 11+ messages in thread
From: Stephen Hemminger @ 2013-07-24 18:51 UTC (permalink / raw)
To: David Miller, Neil Horman
Cc: Jiri Pirko, Jay Vosburgh, Andy Gospodarek, netdev
This started out with fixing a sparse warning, then I realized that
the wrapper function br_netpoll_info could just be collapsed away
by rolling it into the enable code.
Also, eliminate unnecessary goto's
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
--- a/net/bridge/br_private.h 2013-07-24 08:34:05.289987225 -0700
+++ b/net/bridge/br_private.h 2013-07-24 08:34:09.581940104 -0700
@@ -333,11 +333,6 @@ extern void br_dev_delete(struct net_dev
extern netdev_tx_t br_dev_xmit(struct sk_buff *skb,
struct net_device *dev);
#ifdef CONFIG_NET_POLL_CONTROLLER
-static inline struct netpoll_info *br_netpoll_info(struct net_bridge *br)
-{
- return br->dev->npinfo;
-}
-
static inline void br_netpoll_send_skb(const struct net_bridge_port *p,
struct sk_buff *skb)
{
@@ -350,11 +345,6 @@ static inline void br_netpoll_send_skb(c
extern int br_netpoll_enable(struct net_bridge_port *p, gfp_t gfp);
extern void br_netpoll_disable(struct net_bridge_port *p);
#else
-static inline struct netpoll_info *br_netpoll_info(struct net_bridge *br)
-{
- return NULL;
-}
-
static inline void br_netpoll_send_skb(const struct net_bridge_port *p,
struct sk_buff *skb)
{
--- a/net/bridge/br_device.c 2013-07-24 08:34:05.289987225 -0700
+++ b/net/bridge/br_device.c 2013-07-24 08:34:09.581940104 -0700
@@ -244,22 +244,22 @@ fail:
int br_netpoll_enable(struct net_bridge_port *p, gfp_t gfp)
{
struct netpoll *np;
- int err = 0;
+ int err;
+
+ if (!p->br->dev->npinfo)
+ return 0;
np = kzalloc(sizeof(*p->np), gfp);
- err = -ENOMEM;
if (!np)
- goto out;
+ return -ENOMEM;
err = __netpoll_setup(np, p->dev, gfp);
if (err) {
kfree(np);
- goto out;
+ return err;
}
p->np = np;
-
-out:
return err;
}
--- a/net/bridge/br_if.c 2013-07-24 08:34:05.289987225 -0700
+++ b/net/bridge/br_if.c 2013-07-24 08:34:09.581940104 -0700
@@ -363,7 +363,8 @@ int br_add_if(struct net_bridge *br, str
if (err)
goto err2;
- if (br_netpoll_info(br) && ((err = br_netpoll_enable(p, GFP_KERNEL))))
+ err = br_netpoll_enable(p, GFP_KERNEL);
+ if (err)
goto err3;
err = netdev_master_upper_dev_link(dev, br->dev);
^ permalink raw reply [flat|nested] 11+ messages in thread
* [PATCH 2/3 net-next] team: cleanup netpoll clode
2013-07-24 18:51 [PATCH 1/3 net-next] bridge: cleanup netpoll code Stephen Hemminger
@ 2013-07-24 18:52 ` Stephen Hemminger
2013-07-24 19:08 ` 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
` (3 subsequent siblings)
4 siblings, 2 replies; 11+ messages in thread
From: Stephen Hemminger @ 2013-07-24 18:52 UTC (permalink / raw)
To: Stephen Hemminger
Cc: David Miller, Neil Horman, Jiri Pirko, Jay Vosburgh,
Andy Gospodarek, netdev
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);
^ permalink raw reply [flat|nested] 11+ messages in thread
* [PATCH 3/3 net-next] bond: cleanup netpoll code
2013-07-24 18:51 [PATCH 1/3 net-next] bridge: cleanup netpoll code Stephen Hemminger
2013-07-24 18:52 ` [PATCH 2/3 net-next] team: cleanup netpoll clode Stephen Hemminger
@ 2013-07-24 18:53 ` Stephen Hemminger
2013-07-24 19:08 ` Jiri Pirko
` (2 more replies)
2013-07-24 19:07 ` [PATCH 1/3 net-next] bridge: " Jiri Pirko
` (2 subsequent siblings)
4 siblings, 3 replies; 11+ messages in thread
From: Stephen Hemminger @ 2013-07-24 18:53 UTC (permalink / raw)
To: Stephen Hemminger
Cc: David Miller, Neil Horman, Jiri Pirko, Jay Vosburgh,
Andy Gospodarek, netdev
This started out with fixing a sparse warning, then I realized that
the wrapper function bond_netpoll_info could just be removed
by rolling it into the enable code.
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
--- a/drivers/net/bonding/bond_main.c 2013-07-24 08:34:05.229987883 -0700
+++ b/drivers/net/bonding/bond_main.c 2013-07-24 08:34:10.917925434 -0700
@@ -1254,12 +1254,6 @@ static int bond_netpoll_setup(struct net
read_unlock(&bond->lock);
return err;
}
-
-static struct netpoll_info *bond_netpoll_info(struct bonding *bond)
-{
- return bond->dev->npinfo;
-}
-
#else
static inline int slave_enable_netpoll(struct slave *slave)
{
@@ -1804,7 +1798,7 @@ int bond_enslave(struct net_device *bond
bond_set_carrier(bond);
#ifdef CONFIG_NET_POLL_CONTROLLER
- slave_dev->npinfo = bond_netpoll_info(bond);
+ slave_dev->npinfo = bond->dev->npinfo;
if (slave_dev->npinfo) {
if (slave_enable_netpoll(new_slave)) {
read_unlock(&bond->lock);
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH 1/3 net-next] bridge: cleanup netpoll code
2013-07-24 18:51 [PATCH 1/3 net-next] bridge: cleanup netpoll code Stephen Hemminger
2013-07-24 18:52 ` [PATCH 2/3 net-next] team: cleanup netpoll clode Stephen Hemminger
2013-07-24 18:53 ` [PATCH 3/3 net-next] bond: cleanup netpoll code Stephen Hemminger
@ 2013-07-24 19:07 ` Jiri Pirko
2013-07-25 13:05 ` Neil Horman
2013-07-26 22:25 ` David Miller
4 siblings, 0 replies; 11+ messages in thread
From: Jiri Pirko @ 2013-07-24 19:07 UTC (permalink / raw)
To: Stephen Hemminger
Cc: David Miller, Neil Horman, Jay Vosburgh, Andy Gospodarek, netdev
Wed, Jul 24, 2013 at 08:51:41PM CEST, stephen@networkplumber.org wrote:
>This started out with fixing a sparse warning, then I realized that
>the wrapper function br_netpoll_info could just be collapsed away
>by rolling it into the enable code.
>
>Also, eliminate unnecessary goto's
>
>Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Reviewed-by: Jiri Pirko <jiri@resnulli.us>
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH 2/3 net-next] team: cleanup netpoll clode
2013-07-24 18:52 ` [PATCH 2/3 net-next] team: cleanup netpoll clode Stephen Hemminger
@ 2013-07-24 19:08 ` Jiri Pirko
2013-07-26 22:25 ` David Miller
1 sibling, 0 replies; 11+ messages in thread
From: Jiri Pirko @ 2013-07-24 19:08 UTC (permalink / raw)
To: Stephen Hemminger
Cc: David Miller, Neil Horman, Jay Vosburgh, Andy Gospodarek, netdev
Wed, Jul 24, 2013 at 08:52:44PM CEST, stephen@networkplumber.org wrote:
>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>
Acked-by: Jiri Pirko <jiri@resnulli.us>
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH 3/3 net-next] bond: cleanup netpoll code
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
2 siblings, 0 replies; 11+ messages in thread
From: Jiri Pirko @ 2013-07-24 19:08 UTC (permalink / raw)
To: Stephen Hemminger
Cc: David Miller, Neil Horman, Jay Vosburgh, Andy Gospodarek, netdev
Wed, Jul 24, 2013 at 08:53:57PM CEST, stephen@networkplumber.org wrote:
>This started out with fixing a sparse warning, then I realized that
>the wrapper function bond_netpoll_info could just be removed
>by rolling it into the enable code.
>
>Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Reviewed-by: Jiri Pirko <jiri@resnulli.us>
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH 1/3 net-next] bridge: cleanup netpoll code
2013-07-24 18:51 [PATCH 1/3 net-next] bridge: cleanup netpoll code Stephen Hemminger
` (2 preceding siblings ...)
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
4 siblings, 0 replies; 11+ messages in thread
From: Neil Horman @ 2013-07-25 13:05 UTC (permalink / raw)
To: Stephen Hemminger
Cc: David Miller, Jiri Pirko, Jay Vosburgh, Andy Gospodarek, netdev
On Wed, Jul 24, 2013 at 11:51:41AM -0700, Stephen Hemminger wrote:
> This started out with fixing a sparse warning, then I realized that
> the wrapper function br_netpoll_info could just be collapsed away
> by rolling it into the enable code.
>
> Also, eliminate unnecessary goto's
>
> Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
>
Acked-by: Neil Horman <nhorman@tuxdriver.com>
>
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH 3/3 net-next] bond: cleanup netpoll code
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
2 siblings, 0 replies; 11+ messages in thread
From: Neil Horman @ 2013-07-25 13:06 UTC (permalink / raw)
To: Stephen Hemminger
Cc: David Miller, Jiri Pirko, Jay Vosburgh, Andy Gospodarek, netdev
On Wed, Jul 24, 2013 at 11:53:57AM -0700, Stephen Hemminger wrote:
> This started out with fixing a sparse warning, then I realized that
> the wrapper function bond_netpoll_info could just be removed
> by rolling it into the enable code.
>
> Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
>
Acked-by: Neil Horman <nhorman@tuxdriver.com>
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH 1/3 net-next] bridge: cleanup netpoll code
2013-07-24 18:51 [PATCH 1/3 net-next] bridge: cleanup netpoll code Stephen Hemminger
` (3 preceding siblings ...)
2013-07-25 13:05 ` Neil Horman
@ 2013-07-26 22:25 ` David Miller
4 siblings, 0 replies; 11+ messages in thread
From: David Miller @ 2013-07-26 22:25 UTC (permalink / raw)
To: stephen; +Cc: nhorman, jiri, fubar, andy, netdev
From: Stephen Hemminger <stephen@networkplumber.org>
Date: Wed, 24 Jul 2013 11:51:41 -0700
> This started out with fixing a sparse warning, then I realized that
> the wrapper function br_netpoll_info could just be collapsed away
> by rolling it into the enable code.
>
> Also, eliminate unnecessary goto's
>
> Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Applied.
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH 2/3 net-next] team: cleanup netpoll clode
2013-07-24 18:52 ` [PATCH 2/3 net-next] team: cleanup netpoll clode Stephen Hemminger
2013-07-24 19:08 ` Jiri Pirko
@ 2013-07-26 22:25 ` David Miller
1 sibling, 0 replies; 11+ messages in thread
From: David Miller @ 2013-07-26 22:25 UTC (permalink / raw)
To: stephen; +Cc: nhorman, jiri, fubar, andy, netdev
From: Stephen Hemminger <stephen@networkplumber.org>
Date: Wed, 24 Jul 2013 11:52:44 -0700
> 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>
Applied.
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH 3/3 net-next] bond: cleanup netpoll code
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
2 siblings, 0 replies; 11+ messages in thread
From: David Miller @ 2013-07-26 22:25 UTC (permalink / raw)
To: stephen; +Cc: nhorman, jiri, fubar, andy, netdev
From: Stephen Hemminger <stephen@networkplumber.org>
Date: Wed, 24 Jul 2013 11:53:57 -0700
> This started out with fixing a sparse warning, then I realized that
> the wrapper function bond_netpoll_info could just be removed
> by rolling it into the enable code.
>
> Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Applied.
^ permalink raw reply [flat|nested] 11+ messages in thread
end of thread, other threads:[~2013-07-26 22:25 UTC | newest]
Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-07-24 18:51 [PATCH 1/3 net-next] bridge: cleanup netpoll code Stephen Hemminger
2013-07-24 18:52 ` [PATCH 2/3 net-next] team: cleanup netpoll clode Stephen Hemminger
2013-07-24 19:08 ` 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
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).