locking/atomics: COCCINELLE/treewide: Convert trivial ACCESS_ONCE() patterns to READ_...
[linux-2.6-block.git] / drivers / net / bonding / bond_main.c
index fc63992ab0e0ad3300aa9a8d991fc107788ae780..af51b90cecbbe211d7822acd8a7682963535d0fa 100644 (file)
@@ -1167,7 +1167,7 @@ static rx_handler_result_t bond_handle_frame(struct sk_buff **pskb)
        slave = bond_slave_get_rcu(skb->dev);
        bond = slave->bond;
 
-       recv_probe = ACCESS_ONCE(bond->recv_probe);
+       recv_probe = READ_ONCE(bond->recv_probe);
        if (recv_probe) {
                ret = recv_probe(skb, bond, slave);
                if (ret == RX_HANDLER_CONSUMED) {
@@ -3810,7 +3810,7 @@ static int bond_xmit_roundrobin(struct sk_buff *skb, struct net_device *bond_dev
                else
                        bond_xmit_slave_id(bond, skb, 0);
        } else {
-               int slave_cnt = ACCESS_ONCE(bond->slave_cnt);
+               int slave_cnt = READ_ONCE(bond->slave_cnt);
 
                if (likely(slave_cnt)) {
                        slave_id = bond_rr_gen_slave_id(bond);
@@ -3972,7 +3972,7 @@ static int bond_3ad_xor_xmit(struct sk_buff *skb, struct net_device *dev)
        unsigned int count;
 
        slaves = rcu_dereference(bond->slave_arr);
-       count = slaves ? ACCESS_ONCE(slaves->count) : 0;
+       count = slaves ? READ_ONCE(slaves->count) : 0;
        if (likely(count)) {
                slave = slaves->arr[bond_xmit_hash(bond, skb) % count];
                bond_dev_queue_xmit(bond, skb, slave->dev);
@@ -4289,7 +4289,7 @@ static int bond_check_params(struct bond_params *params)
        int bond_mode   = BOND_MODE_ROUNDROBIN;
        int xmit_hashtype = BOND_XMIT_POLICY_LAYER2;
        int lacp_fast = 0;
-       int tlb_dynamic_lb = 0;
+       int tlb_dynamic_lb;
 
        /* Convert string parameters. */
        if (mode) {
@@ -4601,16 +4601,13 @@ static int bond_check_params(struct bond_params *params)
        }
        ad_user_port_key = valptr->value;
 
-       if ((bond_mode == BOND_MODE_TLB) || (bond_mode == BOND_MODE_ALB)) {
-               bond_opt_initstr(&newval, "default");
-               valptr = bond_opt_parse(bond_opt_get(BOND_OPT_TLB_DYNAMIC_LB),
-                                       &newval);
-               if (!valptr) {
-                       pr_err("Error: No tlb_dynamic_lb default value");
-                       return -EINVAL;
-               }
-               tlb_dynamic_lb = valptr->value;
+       bond_opt_initstr(&newval, "default");
+       valptr = bond_opt_parse(bond_opt_get(BOND_OPT_TLB_DYNAMIC_LB), &newval);
+       if (!valptr) {
+               pr_err("Error: No tlb_dynamic_lb default value");
+               return -EINVAL;
        }
+       tlb_dynamic_lb = valptr->value;
 
        if (lp_interval == 0) {
                pr_warn("Warning: ip_interval must be between 1 and %d, so it was reset to %d\n",