Commit 63c3a622 authored by Vlad Yasevich's avatar Vlad Yasevich Committed by David S. Miller

bridge: Turn flag change macro into a function.

Turn the flag change macro into a function to allow
easier updates and to reduce space.
Acked-by: default avatarMichael S. Tsirkin <mst@redhat.com>
Signed-off-by: default avatarVlad Yasevich <vyasevic@redhat.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 4c30b525
......@@ -41,20 +41,27 @@ static ssize_t show_##_name(struct net_bridge_port *p, char *buf) \
} \
static int store_##_name(struct net_bridge_port *p, unsigned long v) \
{ \
unsigned long flags = p->flags; \
if (v) \
flags |= _mask; \
else \
flags &= ~_mask; \
if (flags != p->flags) { \
p->flags = flags; \
br_ifinfo_notify(RTM_NEWLINK, p); \
} \
return 0; \
return store_flag(p, v, _mask); \
} \
static BRPORT_ATTR(_name, S_IRUGO | S_IWUSR, \
show_##_name, store_##_name)
static int store_flag(struct net_bridge_port *p, unsigned long v,
unsigned long mask)
{
unsigned long flags = p->flags;
if (v)
flags |= mask;
else
flags &= ~mask;
if (flags != p->flags) {
p->flags = flags;
br_ifinfo_notify(RTM_NEWLINK, p);
}
return 0;
}
static ssize_t show_path_cost(struct net_bridge_port *p, char *buf)
{
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment