Skip to content

Commit

Permalink
[NET] BRIDGE: Fix whitespace errors.
Browse files Browse the repository at this point in the history
Signed-off-by: YOSHIFUJI Hideaki <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
yoshfuji authored and David S. Miller committed Feb 11, 2007
1 parent 8e87d14 commit 9d6f229
Show file tree
Hide file tree
Showing 25 changed files with 128 additions and 128 deletions.
8 changes: 4 additions & 4 deletions net/bridge/br_device.c
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ int br_dev_xmit(struct sk_buff *skb, struct net_device *dev)
skb->mac.raw = skb->data;
skb_pull(skb, ETH_HLEN);

if (dest[0] & 1)
if (dest[0] & 1)
br_flood_deliver(br, skb, 0);
else if ((dst = __br_fdb_get(br, dest)) != NULL)
br_deliver(dst->dst, skb);
Expand Down Expand Up @@ -178,12 +178,12 @@ void br_dev_setup(struct net_device *dev)
dev->change_mtu = br_change_mtu;
dev->destructor = free_netdev;
SET_MODULE_OWNER(dev);
SET_ETHTOOL_OPS(dev, &br_ethtool_ops);
SET_ETHTOOL_OPS(dev, &br_ethtool_ops);
dev->stop = br_dev_stop;
dev->tx_queue_len = 0;
dev->set_mac_address = br_set_mac_address;
dev->priv_flags = IFF_EBRIDGE;

dev->features = NETIF_F_SG | NETIF_F_FRAGLIST | NETIF_F_HIGHDMA |
NETIF_F_TSO | NETIF_F_NO_CSUM | NETIF_F_GSO_ROBUST;
dev->features = NETIF_F_SG | NETIF_F_FRAGLIST | NETIF_F_HIGHDMA |
NETIF_F_TSO | NETIF_F_NO_CSUM | NETIF_F_GSO_ROBUST;
}
34 changes: 17 additions & 17 deletions net/bridge/br_fdb.c
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ static __inline__ unsigned long hold_time(const struct net_bridge *br)
static __inline__ int has_expired(const struct net_bridge *br,
const struct net_bridge_fdb_entry *fdb)
{
return !fdb->is_static
return !fdb->is_static
&& time_before_eq(fdb->ageing_timer + hold_time(br), jiffies);
}

Expand All @@ -71,7 +71,7 @@ void br_fdb_changeaddr(struct net_bridge_port *p, const unsigned char *newaddr)
{
struct net_bridge *br = p->br;
int i;

spin_lock_bh(&br->hash_lock);

/* Search all chains since old address/hash is unknown */
Expand All @@ -85,7 +85,7 @@ void br_fdb_changeaddr(struct net_bridge_port *p, const unsigned char *newaddr)
/* maybe another port has same hw addr? */
struct net_bridge_port *op;
list_for_each_entry(op, &br->port_list, list) {
if (op != p &&
if (op != p &&
!compare_ether_addr(op->dev->dev_addr,
f->addr.addr)) {
f->dst = op;
Expand Down Expand Up @@ -118,8 +118,8 @@ void br_fdb_cleanup(unsigned long _data)
struct hlist_node *h, *n;

hlist_for_each_entry_safe(f, h, n, &br->hash[i], hlist) {
if (!f->is_static &&
time_before_eq(f->ageing_timer + delay, jiffies))
if (!f->is_static &&
time_before_eq(f->ageing_timer + delay, jiffies))
fdb_delete(f);
}
}
Expand All @@ -138,11 +138,11 @@ void br_fdb_delete_by_port(struct net_bridge *br,
spin_lock_bh(&br->hash_lock);
for (i = 0; i < BR_HASH_SIZE; i++) {
struct hlist_node *h, *g;

hlist_for_each_safe(h, g, &br->hash[i]) {
struct net_bridge_fdb_entry *f
= hlist_entry(h, struct net_bridge_fdb_entry, hlist);
if (f->dst != p)
if (f->dst != p)
continue;

if (f->is_static && !do_all)
Expand All @@ -155,7 +155,7 @@ void br_fdb_delete_by_port(struct net_bridge *br,
if (f->is_local) {
struct net_bridge_port *op;
list_for_each_entry(op, &br->port_list, list) {
if (op != p &&
if (op != p &&
!compare_ether_addr(op->dev->dev_addr,
f->addr.addr)) {
f->dst = op;
Expand Down Expand Up @@ -190,14 +190,14 @@ struct net_bridge_fdb_entry *__br_fdb_get(struct net_bridge *br,
}

/* Interface used by ATM hook that keeps a ref count */
struct net_bridge_fdb_entry *br_fdb_get(struct net_bridge *br,
struct net_bridge_fdb_entry *br_fdb_get(struct net_bridge *br,
unsigned char *addr)
{
struct net_bridge_fdb_entry *fdb;

rcu_read_lock();
fdb = __br_fdb_get(br, addr);
if (fdb)
if (fdb)
atomic_inc(&fdb->use_count);
rcu_read_unlock();
return fdb;
Expand All @@ -218,7 +218,7 @@ void br_fdb_put(struct net_bridge_fdb_entry *ent)
}

/*
* Fill buffer with forwarding table records in
* Fill buffer with forwarding table records in
* the API format.
*/
int br_fdb_fillbuf(struct net_bridge *br, void *buf,
Expand All @@ -237,7 +237,7 @@ int br_fdb_fillbuf(struct net_bridge *br, void *buf,
if (num >= maxnum)
goto out;

if (has_expired(br, f))
if (has_expired(br, f))
continue;

if (skip) {
Expand Down Expand Up @@ -277,7 +277,7 @@ static inline struct net_bridge_fdb_entry *fdb_find(struct hlist_head *head,

static struct net_bridge_fdb_entry *fdb_create(struct hlist_head *head,
struct net_bridge_port *source,
const unsigned char *addr,
const unsigned char *addr,
int is_local)
{
struct net_bridge_fdb_entry *fdb;
Expand Down Expand Up @@ -307,17 +307,17 @@ static int fdb_insert(struct net_bridge *br, struct net_bridge_port *source,

fdb = fdb_find(head, addr);
if (fdb) {
/* it is okay to have multiple ports with same
/* it is okay to have multiple ports with same
* address, just use the first one.
*/
if (fdb->is_local)
if (fdb->is_local)
return 0;

printk(KERN_WARNING "%s adding interface with same address "
"as a received packet\n",
source->dev->name);
fdb_delete(fdb);
}
}

if (!fdb_create(head, source, addr, 1))
return -ENOMEM;
Expand Down Expand Up @@ -350,7 +350,7 @@ void br_fdb_update(struct net_bridge *br, struct net_bridge_port *source,
if (likely(fdb)) {
/* attempt to update an entry for a local interface */
if (unlikely(fdb->is_local)) {
if (net_ratelimit())
if (net_ratelimit())
printk(KERN_WARNING "%s: received packet with "
" own address as source address\n",
source->dev->name);
Expand Down
4 changes: 2 additions & 2 deletions net/bridge/br_forward.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
#include "br_private.h"

/* Don't forward packets to originating port or forwarding diasabled */
static inline int should_deliver(const struct net_bridge_port *p,
static inline int should_deliver(const struct net_bridge_port *p,
const struct sk_buff *skb)
{
return (skb->dev != p->dev && p->state == BR_STATE_FORWARDING);
Expand Down Expand Up @@ -101,7 +101,7 @@ void br_forward(const struct net_bridge_port *to, struct sk_buff *skb)

/* called under bridge lock */
static void br_flood(struct net_bridge *br, struct sk_buff *skb, int clone,
void (*__packet_hook)(const struct net_bridge_port *p,
void (*__packet_hook)(const struct net_bridge_port *p,
struct sk_buff *skb))
{
struct net_bridge_port *p;
Expand Down
26 changes: 13 additions & 13 deletions net/bridge/br_if.c
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ static int port_cost(struct net_device *dev)
set_fs(KERNEL_DS);
err = dev_ethtool(&ifr);
set_fs(old_fs);

if (!err) {
switch(ecmd.speed) {
case SPEED_100:
Expand Down Expand Up @@ -191,7 +191,7 @@ static void del_br(struct net_bridge *br)
del_timer_sync(&br->gc_timer);

br_sysfs_delbr(br->dev);
unregister_netdevice(br->dev);
unregister_netdevice(br->dev);
}

static struct net_device *new_bridge_dev(const char *name)
Expand All @@ -201,7 +201,7 @@ static struct net_device *new_bridge_dev(const char *name)

dev = alloc_netdev(sizeof(struct net_bridge), name,
br_dev_setup);

if (!dev)
return NULL;

Expand Down Expand Up @@ -258,12 +258,12 @@ static int find_portno(struct net_bridge *br)
}

/* called with RTNL but without bridge lock */
static struct net_bridge_port *new_nbp(struct net_bridge *br,
static struct net_bridge_port *new_nbp(struct net_bridge *br,
struct net_device *dev)
{
int index;
struct net_bridge_port *p;

index = find_portno(br);
if (index < 0)
return ERR_PTR(index);
Expand All @@ -276,7 +276,7 @@ static struct net_bridge_port *new_nbp(struct net_bridge *br,
dev_hold(dev);
p->dev = dev;
p->path_cost = port_cost(dev);
p->priority = 0x8000 >> BR_PORT_BITS;
p->priority = 0x8000 >> BR_PORT_BITS;
p->port_no = index;
br_init_port(p);
p->state = BR_STATE_DISABLED;
Expand All @@ -298,7 +298,7 @@ int br_add_bridge(const char *name)
int ret;

dev = new_bridge_dev(name);
if (!dev)
if (!dev)
return -ENOMEM;

rtnl_lock();
Expand Down Expand Up @@ -329,7 +329,7 @@ int br_del_bridge(const char *name)

rtnl_lock();
dev = __dev_get_by_name(name);
if (dev == NULL)
if (dev == NULL)
ret = -ENXIO; /* Could not find device */

else if (!(dev->priv_flags & IFF_EBRIDGE)) {
Expand All @@ -340,9 +340,9 @@ int br_del_bridge(const char *name)
else if (dev->flags & IFF_UP) {
/* Not shutdown yet. */
ret = -EBUSY;
}
}

else
else
del_br(netdev_priv(dev));

rtnl_unlock();
Expand Down Expand Up @@ -428,7 +428,7 @@ int br_add_if(struct net_bridge *br, struct net_device *dev)
if (err)
goto err0;

err = br_fdb_insert(br, p, dev->dev_addr);
err = br_fdb_insert(br, p, dev->dev_addr);
if (err)
goto err1;

Expand Down Expand Up @@ -464,8 +464,8 @@ int br_add_if(struct net_bridge *br, struct net_device *dev)
int br_del_if(struct net_bridge *br, struct net_device *dev)
{
struct net_bridge_port *p = dev->br_port;
if (!p || p->br != br)

if (!p || p->br != br)
return -EINVAL;

del_nbp(p);
Expand Down
4 changes: 2 additions & 2 deletions net/bridge/br_input.c
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ static inline int is_link_local(const unsigned char *dest)
* Called via br_handle_frame_hook.
* Return 0 if *pskb should be processed furthur
* 1 if *pskb is handled
* note: already called with rcu_read_lock (preempt_disabled)
* note: already called with rcu_read_lock (preempt_disabled)
*/
int br_handle_frame(struct net_bridge_port *p, struct sk_buff **pskb)
{
Expand All @@ -137,7 +137,7 @@ int br_handle_frame(struct net_bridge_port *p, struct sk_buff **pskb)

if (p->state == BR_STATE_FORWARDING || p->state == BR_STATE_LEARNING) {
if (br_should_route_hook) {
if (br_should_route_hook(pskb))
if (br_should_route_hook(pskb))
return 0;
skb = *pskb;
dest = eth_hdr(skb)->h_dest;
Expand Down
18 changes: 9 additions & 9 deletions net/bridge/br_ioctl.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ static int get_bridge_ifindices(int *indices, int num)
int i = 0;

for (dev = dev_base; dev && i < num; dev = dev->next) {
if (dev->priv_flags & IFF_EBRIDGE)
if (dev->priv_flags & IFF_EBRIDGE)
indices[i++] = dev->ifindex;
}

Expand All @@ -53,7 +53,7 @@ static void get_port_ifindices(struct net_bridge *br, int *ifindices, int num)
* (limited to a page for sanity)
* offset -- number of records to skip
*/
static int get_fdb_entries(struct net_bridge *br, void __user *userbuf,
static int get_fdb_entries(struct net_bridge *br, void __user *userbuf,
unsigned long maxnum, unsigned long offset)
{
int num;
Expand All @@ -69,7 +69,7 @@ static int get_fdb_entries(struct net_bridge *br, void __user *userbuf,
buf = kmalloc(size, GFP_USER);
if (!buf)
return -ENOMEM;

num = br_fdb_fillbuf(br, buf, maxnum, offset);
if (num > 0) {
if (copy_to_user(userbuf, buf, num*sizeof(struct __fdb_entry)))
Expand All @@ -91,7 +91,7 @@ static int add_del_if(struct net_bridge *br, int ifindex, int isadd)
dev = dev_get_by_index(ifindex);
if (dev == NULL)
return -EINVAL;

if (isadd)
ret = br_add_if(br, dev);
else
Expand All @@ -110,7 +110,7 @@ static int old_dev_ioctl(struct net_device *dev, struct ifreq *rq, int cmd)
{
struct net_bridge *br = netdev_priv(dev);
unsigned long args[4];

if (copy_from_user(args, rq->ifr_data, sizeof(args)))
return -EFAULT;

Expand Down Expand Up @@ -143,7 +143,7 @@ static int old_dev_ioctl(struct net_device *dev, struct ifreq *rq, int cmd)
b.tcn_timer_value = br_timer_value(&br->tcn_timer);
b.topology_change_timer_value = br_timer_value(&br->topology_change_timer);
b.gc_timer_value = br_timer_value(&br->gc_timer);
rcu_read_unlock();
rcu_read_unlock();

if (copy_to_user((void __user *)args[1], &b, sizeof(b)))
return -EFAULT;
Expand Down Expand Up @@ -275,7 +275,7 @@ static int old_dev_ioctl(struct net_device *dev, struct ifreq *rq, int cmd)
return -ERANGE;

spin_lock_bh(&br->lock);
if ((p = br_get_port(br, args[1])) == NULL)
if ((p = br_get_port(br, args[1])) == NULL)
ret = -EINVAL;
else
br_stp_set_port_priority(p, args[2]);
Expand All @@ -301,7 +301,7 @@ static int old_dev_ioctl(struct net_device *dev, struct ifreq *rq, int cmd)
}

case BRCTL_GET_FDB_ENTRIES:
return get_fdb_entries(br, (void __user *)args[1],
return get_fdb_entries(br, (void __user *)args[1],
args[2], args[3]);
}

Expand Down Expand Up @@ -368,7 +368,7 @@ int br_ioctl_deviceless_stub(unsigned int cmd, void __user *uarg)
case SIOCGIFBR:
case SIOCSIFBR:
return old_deviceless(uarg);

case SIOCBRADDBR:
case SIOCBRDELBR:
{
Expand Down
Loading

0 comments on commit 9d6f229

Please sign in to comment.