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>
This commit is contained in:

committed by
David S. Miller

parent
f52809483c
commit
93d8bf9fb8
@@ -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;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user