diff options
author | stephen hemminger <stephen@networkplumber.org> | 2013-07-24 11:51:41 -0700 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2013-07-26 15:24:32 -0700 |
commit | 93d8bf9fb8f39d6d3e461db60f883d9f81006159 (patch) | |
tree | 76a01206abcaa10ba5c2733257306cb85eb75e4d /net/bridge/br_device.c | |
parent | f52809483caceaf83bd2c7915a35ace3b6e7b0ef (diff) | |
download | linux-93d8bf9fb8f39d6d3e461db60f883d9f81006159.tar.gz linux-93d8bf9fb8f39d6d3e461db60f883d9f81006159.tar.bz2 linux-93d8bf9fb8f39d6d3e461db60f883d9f81006159.zip |
bridge: cleanup netpoll code
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>
Acked-by: Neil Horman <nhorman@tuxdriver.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/bridge/br_device.c')
-rw-r--r-- | net/bridge/br_device.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/net/bridge/br_device.c b/net/bridge/br_device.c index 2ef66781fedb..50d86b3e3941 100644 --- a/net/bridge/br_device.c +++ b/net/bridge/br_device.c @@ -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; } |