Commit 8586007c authored by Shmulik Hen's avatar Shmulik Hen Committed by Jeff Garzik

[PATCH] bonding cleanup 2.6 - fix indentations.

parent bc74d636
...@@ -907,8 +907,8 @@ static void alb_swap_mac_addr(struct bonding *bond, struct slave *slave1, struct ...@@ -907,8 +907,8 @@ static void alb_swap_mac_addr(struct bonding *bond, struct slave *slave1, struct
if (bond->alb_info.rlb_enabled && slaves_state_differ) { if (bond->alb_info.rlb_enabled && slaves_state_differ) {
/* A disabled slave was assigned an active mac addr */ /* A disabled slave was assigned an active mac addr */
rlb_teach_disabled_mac_on_primary(bond, rlb_teach_disabled_mac_on_primary(bond,
disabled_slave->dev->dev_addr); disabled_slave->dev->dev_addr);
} }
} }
...@@ -942,8 +942,8 @@ static void alb_change_hw_addr_on_detach(struct bonding *bond, struct slave *sla ...@@ -942,8 +942,8 @@ static void alb_change_hw_addr_on_detach(struct bonding *bond, struct slave *sla
if (perm_curr_diff && perm_bond_diff) { if (perm_curr_diff && perm_bond_diff) {
bond_for_each_slave(bond, tmp_slave, i) { bond_for_each_slave(bond, tmp_slave, i) {
if (!memcmp(slave->perm_hwaddr, if (!memcmp(slave->perm_hwaddr,
tmp_slave->dev->dev_addr, tmp_slave->dev->dev_addr,
ETH_ALEN)) { ETH_ALEN)) {
found = 1; found = 1;
break; break;
} }
...@@ -1247,8 +1247,8 @@ int bond_alb_xmit(struct sk_buff *skb, struct net_device *bond_dev) ...@@ -1247,8 +1247,8 @@ int bond_alb_xmit(struct sk_buff *skb, struct net_device *bond_dev)
skb->dev = tx_slave->dev; skb->dev = tx_slave->dev;
if (tx_slave != bond->curr_active_slave) { if (tx_slave != bond->curr_active_slave) {
memcpy(eth_data->h_source, memcpy(eth_data->h_source,
tx_slave->dev->dev_addr, tx_slave->dev->dev_addr,
ETH_ALEN); ETH_ALEN);
} }
dev_queue_xmit(skb); dev_queue_xmit(skb);
} else { } else {
...@@ -1495,7 +1495,7 @@ void bond_alb_handle_active_change(struct bonding *bond, struct slave *new_slave ...@@ -1495,7 +1495,7 @@ void bond_alb_handle_active_change(struct bonding *bond, struct slave *new_slave
/* find slave that is holding the bond's mac address */ /* find slave that is holding the bond's mac address */
bond_for_each_slave(bond, swap_slave, i) { bond_for_each_slave(bond, swap_slave, i) {
if (!memcmp(swap_slave->dev->dev_addr, if (!memcmp(swap_slave->dev->dev_addr,
bond->dev->dev_addr, ETH_ALEN)) { bond->dev->dev_addr, ETH_ALEN)) {
found = 1; found = 1;
break; break;
} }
......
...@@ -736,20 +736,20 @@ static int bond_update_speed_duplex(struct slave *slave) ...@@ -736,20 +736,20 @@ static int bond_update_speed_duplex(struct slave *slave)
} }
switch (slave->speed) { switch (slave->speed) {
case SPEED_10: case SPEED_10:
case SPEED_100: case SPEED_100:
case SPEED_1000: case SPEED_1000:
break; break;
default: default:
goto err_out; goto err_out;
} }
switch (slave->duplex) { switch (slave->duplex) {
case DUPLEX_FULL: case DUPLEX_FULL:
case DUPLEX_HALF: case DUPLEX_HALF:
break; break;
default: default:
goto err_out; goto err_out;
} }
return 0; return 0;
...@@ -814,8 +814,8 @@ static int bond_check_dev_link(struct net_device *slave_dev, int reporting) ...@@ -814,8 +814,8 @@ static int bond_check_dev_link(struct net_device *slave_dev, int reporting)
/* try SIOCETHTOOL ioctl, some drivers cache ETHTOOL_GLINK */ /* try SIOCETHTOOL ioctl, some drivers cache ETHTOOL_GLINK */
/* for a period of time so we attempt to get link status */ /* for a period of time so we attempt to get link status */
/* from it last if the above MII ioctls fail... */ /* from it last if the above MII ioctls fail... */
etool.cmd = ETHTOOL_GLINK; etool.cmd = ETHTOOL_GLINK;
ifr.ifr_data = (char*)&etool; ifr.ifr_data = (char*)&etool;
if (IOCTL(slave_dev, &ifr, SIOCETHTOOL) == 0) { if (IOCTL(slave_dev, &ifr, SIOCETHTOOL) == 0) {
if (etool.data == 1) { if (etool.data == 1) {
return BMSR_LSTATUS; return BMSR_LSTATUS;
...@@ -1053,7 +1053,7 @@ static int bond_mc_list_copy(struct dev_mc_list *mc_list, struct bonding *bond, ...@@ -1053,7 +1053,7 @@ static int bond_mc_list_copy(struct dev_mc_list *mc_list, struct bonding *bond,
{ {
struct dev_mc_list *dmi, *new_dmi; struct dev_mc_list *dmi, *new_dmi;
for (dmi = mc_list; dmi; dmi = dmi->next) { for (dmi = mc_list; dmi; dmi = dmi->next) {
new_dmi = kmalloc(sizeof(struct dev_mc_list), gpf_flag); new_dmi = kmalloc(sizeof(struct dev_mc_list), gpf_flag);
if (!new_dmi) { if (!new_dmi) {
...@@ -1145,20 +1145,20 @@ static void bond_set_multicast_list(struct net_device *bond_dev) ...@@ -1145,20 +1145,20 @@ static void bond_set_multicast_list(struct net_device *bond_dev)
/* /*
* Do promisc before checking multicast_mode * Do promisc before checking multicast_mode
*/ */
if ( (bond_dev->flags & IFF_PROMISC) && !(bond->flags & IFF_PROMISC) ) { if ((bond_dev->flags & IFF_PROMISC) && !(bond->flags & IFF_PROMISC)) {
bond_set_promiscuity(bond, 1); bond_set_promiscuity(bond, 1);
} }
if ( !(bond_dev->flags & IFF_PROMISC) && (bond->flags & IFF_PROMISC) ) { if (!(bond_dev->flags & IFF_PROMISC) && (bond->flags & IFF_PROMISC)) {
bond_set_promiscuity(bond, -1); bond_set_promiscuity(bond, -1);
} }
/* set allmulti flag to slaves */ /* set allmulti flag to slaves */
if ( (bond_dev->flags & IFF_ALLMULTI) && !(bond->flags & IFF_ALLMULTI) ) { if ((bond_dev->flags & IFF_ALLMULTI) && !(bond->flags & IFF_ALLMULTI)) {
bond_set_allmulti(bond, 1); bond_set_allmulti(bond, 1);
} }
if ( !(bond_dev->flags & IFF_ALLMULTI) && (bond->flags & IFF_ALLMULTI) ) { if (!(bond_dev->flags & IFF_ALLMULTI) && (bond->flags & IFF_ALLMULTI)) {
bond_set_allmulti(bond, -1); bond_set_allmulti(bond, -1);
} }
...@@ -1324,13 +1324,13 @@ static int bond_enslave(struct net_device *bond_dev, struct net_device *slave_de ...@@ -1324,13 +1324,13 @@ static int bond_enslave(struct net_device *bond_dev, struct net_device *slave_de
* The application already set the master's * The application already set the master's
* mac address to that of the first slave * mac address to that of the first slave
*/ */
memcpy(addr.sa_data, bond_dev->dev_addr, bond_dev->addr_len); memcpy(addr.sa_data, bond_dev->dev_addr, bond_dev->addr_len);
addr.sa_family = slave_dev->type; addr.sa_family = slave_dev->type;
res = slave_dev->set_mac_address(slave_dev, &addr); res = slave_dev->set_mac_address(slave_dev, &addr);
if (res) { if (res) {
dprintk("Error %d calling set_mac_address\n", res); dprintk("Error %d calling set_mac_address\n", res);
goto err_free; goto err_free;
} }
/* open the slave since the application closed it */ /* open the slave since the application closed it */
res = dev_open(slave_dev); res = dev_open(slave_dev);
...@@ -2274,7 +2274,7 @@ static void bond_mii_monitor(struct net_device *bond_dev) ...@@ -2274,7 +2274,7 @@ static void bond_mii_monitor(struct net_device *bond_dev)
default: default:
/* Should not happen */ /* Should not happen */
printk(KERN_ERR "bonding: Error: %s Illegal value (link=%d)\n", printk(KERN_ERR "bonding: Error: %s Illegal value (link=%d)\n",
slave->dev->name, slave->link); slave->dev->name, slave->link);
goto out; goto out;
} /* end of switch (slave->link) */ } /* end of switch (slave->link) */
...@@ -2350,8 +2350,8 @@ static void bond_loadbalance_arp_mon(struct net_device *bond_dev) ...@@ -2350,8 +2350,8 @@ static void bond_loadbalance_arp_mon(struct net_device *bond_dev)
* so it can wait * so it can wait
*/ */
bond_for_each_slave(bond, slave, i) { bond_for_each_slave(bond, slave, i) {
if (slave->link != BOND_LINK_UP) { if (slave->link != BOND_LINK_UP) {
if (((jiffies - slave->dev->trans_start) <= delta_in_ticks) && if (((jiffies - slave->dev->trans_start) <= delta_in_ticks) &&
((jiffies - slave->dev->last_rx) <= delta_in_ticks)) { ((jiffies - slave->dev->last_rx) <= delta_in_ticks)) {
slave->link = BOND_LINK_UP; slave->link = BOND_LINK_UP;
...@@ -2476,7 +2476,7 @@ static void bond_activebackup_arp_mon(struct net_device *bond_dev) ...@@ -2476,7 +2476,7 @@ static void bond_activebackup_arp_mon(struct net_device *bond_dev)
* so it can wait * so it can wait
*/ */
bond_for_each_slave(bond, slave, i) { bond_for_each_slave(bond, slave, i) {
if (slave->link != BOND_LINK_UP) { if (slave->link != BOND_LINK_UP) {
if ((jiffies - slave->dev->last_rx) <= delta_in_ticks) { if ((jiffies - slave->dev->last_rx) <= delta_in_ticks) {
slave->link = BOND_LINK_UP; slave->link = BOND_LINK_UP;
...@@ -3367,7 +3367,7 @@ static int bond_info_open(struct inode *inode, struct file *file) ...@@ -3367,7 +3367,7 @@ static int bond_info_open(struct inode *inode, struct file *file)
} }
static struct file_operations bond_info_fops = { static struct file_operations bond_info_fops = {
.owner = THIS_MODULE, .owner = THIS_MODULE,
.open = bond_info_open, .open = bond_info_open,
.read = seq_read, .read = seq_read,
.llseek = seq_lseek, .llseek = seq_lseek,
...@@ -3875,7 +3875,7 @@ static inline int bond_parse_parm(char *mode_arg, struct bond_parm_tbl *tbl) ...@@ -3875,7 +3875,7 @@ static inline int bond_parse_parm(char *mode_arg, struct bond_parm_tbl *tbl)
if ((isdigit(*mode_arg) && if ((isdigit(*mode_arg) &&
tbl[i].mode == simple_strtol(mode_arg, NULL, 0)) || tbl[i].mode == simple_strtol(mode_arg, NULL, 0)) ||
(strncmp(mode_arg, tbl[i].modename, (strncmp(mode_arg, tbl[i].modename,
strlen(tbl[i].modename)) == 0)) { strlen(tbl[i].modename)) == 0)) {
return tbl[i].mode; return tbl[i].mode;
} }
} }
...@@ -4044,9 +4044,9 @@ static int bond_check_params(void) ...@@ -4044,9 +4044,9 @@ static int bond_check_params(void)
arp_interval = BOND_LINK_ARP_INTERV; arp_interval = BOND_LINK_ARP_INTERV;
} }
for (arp_ip_count=0 ; for (arp_ip_count=0 ;
(arp_ip_count < MAX_ARP_IP_TARGETS) && arp_ip_target[arp_ip_count]; (arp_ip_count < MAX_ARP_IP_TARGETS) && arp_ip_target[arp_ip_count];
arp_ip_count++ ) { arp_ip_count++) {
/* not complete check, but should be good enough to /* not complete check, but should be good enough to
catch mistakes */ catch mistakes */
if (!isdigit(arp_ip_target[arp_ip_count][0])) { if (!isdigit(arp_ip_target[arp_ip_count][0])) {
...@@ -4059,7 +4059,7 @@ static int bond_check_params(void) ...@@ -4059,7 +4059,7 @@ static int bond_check_params(void)
u32 ip = in_aton(arp_ip_target[arp_ip_count]); u32 ip = in_aton(arp_ip_target[arp_ip_count]);
arp_target[arp_ip_count] = ip; arp_target[arp_ip_count] = ip;
} }
} }
if (arp_interval && !arp_ip_count) { if (arp_interval && !arp_ip_count) {
/* don't allow arping if no arp_ip_target given... */ /* don't allow arping if no arp_ip_target given... */
......
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