diff -Nuarp a/drivers/net/bonding/bond_3ad.c b/drivers/net/bonding/bond_3ad.c --- a/drivers/net/bonding/bond_3ad.c Sun Dec 21 16:09:06 2003 +++ b/drivers/net/bonding/bond_3ad.c Sun Dec 21 16:09:06 2003 @@ -124,6 +124,7 @@ static struct mac_addr null_mac_addr = {{0, 0, 0, 0, 0, 0}}; static u16 ad_ticks_per_sec; +static const int ad_delta_in_ticks = (AD_TIMER_INTERVAL * HZ) / 1000; // ================= 3AD api to bonding and kernel code ================== static u16 __get_link_speed(struct port *port); @@ -2123,7 +2124,6 @@ void bond_3ad_state_machine_handler(stru { struct port *port; struct aggregator *aggregator; - int delta_in_ticks = AD_TIMER_INTERVAL * HZ / 1000; read_lock(&bond->lock); @@ -2170,7 +2170,7 @@ void bond_3ad_state_machine_handler(stru } re_arm: - mod_timer(&(BOND_AD_INFO(bond).ad_timer), jiffies + delta_in_ticks); + mod_timer(&(BOND_AD_INFO(bond).ad_timer), jiffies + ad_delta_in_ticks); out: read_unlock(&bond->lock); } @@ -2355,7 +2355,7 @@ int bond_3ad_get_active_agg_info(struct int bond_3ad_xmit_xor(struct sk_buff *skb, struct net_device *dev) { struct slave *slave, *start_at; - struct bonding *bond = (struct bonding *)dev->priv; + struct bonding *bond = dev->priv; struct ethhdr *data = (struct ethhdr *)skb->data; int slave_agg_no; int slaves_in_agg; @@ -2436,7 +2436,7 @@ free_out: int bond_3ad_lacpdu_recv(struct sk_buff *skb, struct net_device *dev, struct packet_type* ptype) { - struct bonding *bond = (struct bonding *)dev->priv; + struct bonding *bond = dev->priv; struct slave *slave = NULL; int ret = NET_RX_DROP; diff -Nuarp a/drivers/net/bonding/bond_alb.c b/drivers/net/bonding/bond_alb.c --- a/drivers/net/bonding/bond_alb.c Sun Dec 21 16:09:06 2003 +++ b/drivers/net/bonding/bond_alb.c Sun Dec 21 16:09:06 2003 @@ -92,6 +92,7 @@ #define RLB_PROMISC_TIMEOUT 10*ALB_TIMER_TICKS_PER_SEC static const u8 mac_bcast[ETH_ALEN] = {0xff,0xff,0xff,0xff,0xff,0xff}; +static const int alb_delta_in_ticks = HZ / ALB_TIMER_TICKS_PER_SEC; #pragma pack(1) struct learning_pkt { @@ -347,7 +348,7 @@ static void rlb_update_entry_from_arp(st static int rlb_arp_recv(struct sk_buff *skb, struct net_device *bond_dev, struct packet_type *ptype) { - struct bonding *bond = (struct bonding *)bond_dev->priv; + struct bonding *bond = bond_dev->priv; struct arp_pkt *arp = (struct arp_pkt *)skb->data; int res = NET_RX_DROP; @@ -1170,7 +1171,7 @@ void bond_alb_deinitialize(struct bondin int bond_alb_xmit(struct sk_buff *skb, struct net_device *bond_dev) { - struct bonding *bond = (struct bonding *)bond_dev->priv; + struct bonding *bond = bond_dev->priv; struct ethhdr *eth_data = (struct ethhdr *)skb->mac.raw = skb->data; struct alb_bond_info *bond_info = &(BOND_ALB_INFO(bond)); struct slave *tx_slave = NULL; @@ -1282,7 +1283,6 @@ void bond_alb_monitor(struct bonding *bo { struct alb_bond_info *bond_info = &(BOND_ALB_INFO(bond)); struct slave *slave; - int delta_in_ticks = HZ / ALB_TIMER_TICKS_PER_SEC; int i; read_lock(&bond->lock); @@ -1383,7 +1383,7 @@ void bond_alb_monitor(struct bonding *bo } re_arm: - mod_timer(&(bond_info->alb_timer), jiffies + delta_in_ticks); + mod_timer(&(bond_info->alb_timer), jiffies + alb_delta_in_ticks); out: read_unlock(&bond->lock); } @@ -1527,7 +1527,7 @@ void bond_alb_handle_active_change(struc int bond_alb_set_mac_address(struct net_device *bond_dev, void *addr) { - struct bonding *bond = (struct bonding *)bond_dev->priv; + struct bonding *bond = bond_dev->priv; struct sockaddr *sa = addr; struct slave *slave, *swap_slave; int res; diff -Nuarp a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c --- a/drivers/net/bonding/bond_main.c Sun Dec 21 16:09:06 2003 +++ b/drivers/net/bonding/bond_main.c Sun Dec 21 16:09:06 2003 @@ -1173,7 +1173,7 @@ static int bond_sethwaddr(struct net_dev /* enslave device to bond device */ static int bond_enslave(struct net_device *bond_dev, struct net_device *slave_dev) { - struct bonding *bond = (struct bonding *)bond_dev->priv; + struct bonding *bond = bond_dev->priv; struct slave *new_slave = NULL; struct dev_mc_list *dmi; struct sockaddr addr; @@ -1556,7 +1556,7 @@ err_free: */ static int bond_release(struct net_device *bond_dev, struct net_device *slave_dev) { - struct bonding *bond = (struct bonding *)bond_dev->priv; + struct bonding *bond = bond_dev->priv; struct slave *slave; struct sockaddr addr; int mac_addr_differ; @@ -1706,7 +1706,7 @@ static int bond_release(struct net_devic */ static int bond_release_all(struct net_device *bond_dev) { - struct bonding *bond = (struct bonding *)bond_dev->priv; + struct bonding *bond = bond_dev->priv; struct slave *slave; struct net_device *slave_dev; struct sockaddr addr; @@ -1819,7 +1819,7 @@ out: */ static int bond_ioctl_change_active(struct net_device *bond_dev, struct net_device *slave_dev) { - struct bonding *bond = (struct bonding *)bond_dev->priv; + struct bonding *bond = bond_dev->priv; struct slave *old_active = NULL; struct slave *new_active = NULL; int res = 0; @@ -1910,7 +1910,7 @@ static int bond_ethtool_ioctl(struct net static int bond_info_query(struct net_device *bond_dev, struct ifbond *info) { - struct bonding *bond = (struct bonding *)bond_dev->priv; + struct bonding *bond = bond_dev->priv; info->bond_mode = bond_mode; info->miimon = miimon; @@ -1924,7 +1924,7 @@ static int bond_info_query(struct net_de static int bond_slave_info_query(struct net_device *bond_dev, struct ifslave *info) { - struct bonding *bond = (struct bonding *)bond_dev->priv; + struct bonding *bond = bond_dev->priv; struct slave *slave; int i, found = 0; @@ -1960,10 +1960,10 @@ static int bond_slave_info_query(struct /* this function is called regularly to monitor each slave's link. */ static void bond_mii_monitor(struct net_device *bond_dev) { - struct bonding *bond = (struct bonding *)bond_dev->priv; + struct bonding *bond = bond_dev->priv; struct slave *slave, *oldcurrent; int do_failover = 0; - int delta_in_ticks = miimon * HZ / 1000; + int delta_in_ticks = (miimon * HZ) / 1000; int i; read_lock(&bond->lock); @@ -2215,10 +2215,10 @@ static void bond_arp_send_all(struct sla */ static void bond_loadbalance_arp_mon(struct net_device *bond_dev) { - struct bonding *bond = (struct bonding *)bond_dev->priv; + struct bonding *bond = bond_dev->priv; struct slave *slave, *oldcurrent; int do_failover = 0; - int delta_in_ticks = arp_interval * HZ / 1000; + int delta_in_ticks = (arp_interval * HZ) / 1000; int i; read_lock(&bond->lock); @@ -2349,9 +2349,9 @@ out: */ static void bond_activebackup_arp_mon(struct net_device *bond_dev) { - struct bonding *bond = (struct bonding *)bond_dev->priv; + struct bonding *bond = bond_dev->priv; struct slave *slave; - int delta_in_ticks = arp_interval * HZ / 1000; + int delta_in_ticks = (arp_interval * HZ) / 1000; int i; read_lock(&bond->lock); @@ -2860,7 +2860,7 @@ static int bond_event_changename(struct static int bond_master_netdev_event(unsigned long event, struct net_device *bond_dev) { - struct bonding *event_bond = (struct bonding *)bond_dev->priv; + struct bonding *event_bond = bond_dev->priv; switch (event) { case NETDEV_CHANGENAME: @@ -2984,7 +2984,7 @@ static void bond_unregister_lacpdu(struc static int bond_open(struct net_device *bond_dev) { - struct bonding *bond = (struct bonding *)bond_dev->priv; + struct bonding *bond = bond_dev->priv; struct timer_list *mii_timer = &bond->mii_timer; struct timer_list *arp_timer = &bond->arp_timer; @@ -3046,7 +3046,7 @@ static int bond_open(struct net_device * static int bond_close(struct net_device *bond_dev) { - struct bonding *bond = (struct bonding *)bond_dev->priv; + struct bonding *bond = bond_dev->priv; write_lock_bh(&bond->lock); @@ -3102,7 +3102,7 @@ static int bond_close(struct net_device static struct net_device_stats *bond_get_stats(struct net_device *bond_dev) { - struct bonding *bond = (struct bonding *)bond_dev->priv; + struct bonding *bond = bond_dev->priv; struct net_device_stats *stats = &(bond->stats), *sstats; struct slave *slave; int i; @@ -3179,7 +3179,7 @@ static int bond_do_ioctl(struct net_devi } if (mii->reg_num == 1) { - struct bonding *bond = (struct bonding *)bond_dev->priv; + struct bonding *bond = bond_dev->priv; mii->val_out = 0; read_lock_bh(&bond->lock); read_lock(&bond->curr_slave_lock); @@ -3296,7 +3296,7 @@ static int bond_do_ioctl(struct net_devi static void bond_set_multicast_list(struct net_device *bond_dev) { - struct bonding *bond = (struct bonding *)bond_dev->priv; + struct bonding *bond = bond_dev->priv; struct dev_mc_list *dmi; write_lock_bh(&bond->lock); @@ -3349,7 +3349,7 @@ static void bond_set_multicast_list(stru */ static int bond_change_mtu(struct net_device *bond_dev, int new_mtu) { - struct bonding *bond = (struct bonding *)bond_dev->priv; + struct bonding *bond = bond_dev->priv; struct slave *slave, *stop_at; int res = 0; int i; @@ -3429,7 +3429,7 @@ unwind: */ static int bond_set_mac_address(struct net_device *bond_dev, void *addr) { - struct bonding *bond = (struct bonding *)bond_dev->priv; + struct bonding *bond = bond_dev->priv; struct sockaddr *sa = addr, tmp_sa; struct slave *slave, *stop_at; int res = 0; @@ -3503,7 +3503,7 @@ unwind: static int bond_xmit_roundrobin(struct sk_buff *skb, struct net_device *bond_dev) { - struct bonding *bond = (struct bonding *)bond_dev->priv; + struct bonding *bond = bond_dev->priv; struct slave *slave, *start_at; int i; @@ -3553,7 +3553,7 @@ free_out: */ static int bond_xmit_activebackup(struct sk_buff *skb, struct net_device *bond_dev) { - struct bonding *bond = (struct bonding *)bond_dev->priv; + struct bonding *bond = bond_dev->priv; /* if we are sending arp packets, try to at least identify our own ip address */ @@ -3599,7 +3599,7 @@ free_out: */ static int bond_xmit_xor(struct sk_buff *skb, struct net_device *bond_dev) { - struct bonding *bond = (struct bonding *)bond_dev->priv; + struct bonding *bond = bond_dev->priv; struct ethhdr *data = (struct ethhdr *)skb->data; struct slave *slave, *start_at; int slave_no; @@ -3649,7 +3649,7 @@ free_out: */ static int bond_xmit_broadcast(struct sk_buff *skb, struct net_device *bond_dev) { - struct bonding *bond = (struct bonding *)bond_dev->priv; + struct bonding *bond = bond_dev->priv; struct slave *slave, *start_at; struct net_device *tx_dev = NULL; int i; @@ -3723,7 +3723,7 @@ static int bond_accept_fastpath(struct n */ static int __init bond_init(struct net_device *bond_dev) { - struct bonding *bond = (struct bonding *)bond_dev->priv; + struct bonding *bond = bond_dev->priv; int count; dprintk("Begin bond_init for %s\n", bond_dev->name); @@ -3820,7 +3820,7 @@ static int __init bond_init(struct net_d */ static inline void bond_deinit(struct net_device *bond_dev) { - struct bonding *bond = (struct bonding *)bond_dev->priv; + struct bonding *bond = bond_dev->priv; list_del(&bond->bond_list);