diff options
author | Sven Eckelmann <sven@narfation.org> | 2012-07-08 11:13:15 -0400 |
---|---|---|
committer | Antonio Quartulli <ordex@autistici.org> | 2012-08-23 08:20:20 -0400 |
commit | bbb1f90efba89b31fc5e329d5fcaf10aca99212b (patch) | |
tree | db2645f7068d5da5b501559e6a2972c20f361082 /net/batman-adv/bat_iv_ogm.c | |
parent | 8de47de5757bd5f64a823185e544210d95fd2088 (diff) |
batman-adv: Don't break statements after assignment operator
Signed-off-by: Sven Eckelmann <sven@narfation.org>
Signed-off-by: Antonio Quartulli <ordex@autistici.org>
Diffstat (limited to 'net/batman-adv/bat_iv_ogm.c')
-rw-r--r-- | net/batman-adv/bat_iv_ogm.c | 39 |
1 files changed, 21 insertions, 18 deletions
diff --git a/net/batman-adv/bat_iv_ogm.c b/net/batman-adv/bat_iv_ogm.c index daaccc1326d4..616d52d9cd0a 100644 --- a/net/batman-adv/bat_iv_ogm.c +++ b/net/batman-adv/bat_iv_ogm.c | |||
@@ -588,6 +588,8 @@ static void batadv_iv_ogm_schedule(struct batadv_hard_iface *hard_iface) | |||
588 | struct batadv_ogm_packet *batadv_ogm_packet; | 588 | struct batadv_ogm_packet *batadv_ogm_packet; |
589 | struct batadv_hard_iface *primary_if; | 589 | struct batadv_hard_iface *primary_if; |
590 | int vis_server, tt_num_changes = 0; | 590 | int vis_server, tt_num_changes = 0; |
591 | uint32_t seqno; | ||
592 | uint8_t bandwidth; | ||
591 | 593 | ||
592 | vis_server = atomic_read(&bat_priv->vis_mode); | 594 | vis_server = atomic_read(&bat_priv->vis_mode); |
593 | primary_if = batadv_primary_if_get_selected(bat_priv); | 595 | primary_if = batadv_primary_if_get_selected(bat_priv); |
@@ -601,8 +603,8 @@ static void batadv_iv_ogm_schedule(struct batadv_hard_iface *hard_iface) | |||
601 | batadv_ogm_packet = (struct batadv_ogm_packet *)hard_iface->packet_buff; | 603 | batadv_ogm_packet = (struct batadv_ogm_packet *)hard_iface->packet_buff; |
602 | 604 | ||
603 | /* change sequence number to network order */ | 605 | /* change sequence number to network order */ |
604 | batadv_ogm_packet->seqno = | 606 | seqno = (uint32_t)atomic_read(&hard_iface->seqno); |
605 | htonl((uint32_t)atomic_read(&hard_iface->seqno)); | 607 | batadv_ogm_packet->seqno = htonl(seqno); |
606 | atomic_inc(&hard_iface->seqno); | 608 | atomic_inc(&hard_iface->seqno); |
607 | 609 | ||
608 | batadv_ogm_packet->ttvn = atomic_read(&bat_priv->tt.vn); | 610 | batadv_ogm_packet->ttvn = atomic_read(&bat_priv->tt.vn); |
@@ -615,12 +617,13 @@ static void batadv_iv_ogm_schedule(struct batadv_hard_iface *hard_iface) | |||
615 | else | 617 | else |
616 | batadv_ogm_packet->flags &= ~BATADV_VIS_SERVER; | 618 | batadv_ogm_packet->flags &= ~BATADV_VIS_SERVER; |
617 | 619 | ||
618 | if ((hard_iface == primary_if) && | 620 | if (hard_iface == primary_if && |
619 | (atomic_read(&bat_priv->gw_mode) == BATADV_GW_MODE_SERVER)) | 621 | atomic_read(&bat_priv->gw_mode) == BATADV_GW_MODE_SERVER) { |
620 | batadv_ogm_packet->gw_flags = | 622 | bandwidth = (uint8_t)atomic_read(&bat_priv->gw_bandwidth); |
621 | (uint8_t)atomic_read(&bat_priv->gw_bandwidth); | 623 | batadv_ogm_packet->gw_flags = bandwidth; |
622 | else | 624 | } else { |
623 | batadv_ogm_packet->gw_flags = BATADV_NO_FLAGS; | 625 | batadv_ogm_packet->gw_flags = BATADV_NO_FLAGS; |
626 | } | ||
624 | 627 | ||
625 | batadv_slide_own_bcast_window(hard_iface); | 628 | batadv_slide_own_bcast_window(hard_iface); |
626 | batadv_iv_ogm_queue_add(bat_priv, hard_iface->packet_buff, | 629 | batadv_iv_ogm_queue_add(bat_priv, hard_iface->packet_buff, |
@@ -644,8 +647,9 @@ batadv_iv_ogm_orig_update(struct batadv_priv *bat_priv, | |||
644 | struct batadv_neigh_node *router = NULL; | 647 | struct batadv_neigh_node *router = NULL; |
645 | struct batadv_orig_node *orig_node_tmp; | 648 | struct batadv_orig_node *orig_node_tmp; |
646 | struct hlist_node *node; | 649 | struct hlist_node *node; |
647 | uint8_t bcast_own_sum_orig, bcast_own_sum_neigh; | 650 | uint8_t sum_orig, sum_neigh; |
648 | uint8_t *neigh_addr; | 651 | uint8_t *neigh_addr; |
652 | uint8_t tq_avg; | ||
649 | 653 | ||
650 | batadv_dbg(BATADV_DBG_BATMAN, bat_priv, | 654 | batadv_dbg(BATADV_DBG_BATMAN, bat_priv, |
651 | "update_originator(): Searching and updating originator entry of received packet\n"); | 655 | "update_originator(): Searching and updating originator entry of received packet\n"); |
@@ -669,8 +673,8 @@ batadv_iv_ogm_orig_update(struct batadv_priv *bat_priv, | |||
669 | spin_lock_bh(&tmp_neigh_node->lq_update_lock); | 673 | spin_lock_bh(&tmp_neigh_node->lq_update_lock); |
670 | batadv_ring_buffer_set(tmp_neigh_node->tq_recv, | 674 | batadv_ring_buffer_set(tmp_neigh_node->tq_recv, |
671 | &tmp_neigh_node->tq_index, 0); | 675 | &tmp_neigh_node->tq_index, 0); |
672 | tmp_neigh_node->tq_avg = | 676 | tq_avg = batadv_ring_buffer_avg(tmp_neigh_node->tq_recv); |
673 | batadv_ring_buffer_avg(tmp_neigh_node->tq_recv); | 677 | tmp_neigh_node->tq_avg = tq_avg; |
674 | spin_unlock_bh(&tmp_neigh_node->lq_update_lock); | 678 | spin_unlock_bh(&tmp_neigh_node->lq_update_lock); |
675 | } | 679 | } |
676 | 680 | ||
@@ -729,17 +733,15 @@ batadv_iv_ogm_orig_update(struct batadv_priv *bat_priv, | |||
729 | if (router && (neigh_node->tq_avg == router->tq_avg)) { | 733 | if (router && (neigh_node->tq_avg == router->tq_avg)) { |
730 | orig_node_tmp = router->orig_node; | 734 | orig_node_tmp = router->orig_node; |
731 | spin_lock_bh(&orig_node_tmp->ogm_cnt_lock); | 735 | spin_lock_bh(&orig_node_tmp->ogm_cnt_lock); |
732 | bcast_own_sum_orig = | 736 | sum_orig = orig_node_tmp->bcast_own_sum[if_incoming->if_num]; |
733 | orig_node_tmp->bcast_own_sum[if_incoming->if_num]; | ||
734 | spin_unlock_bh(&orig_node_tmp->ogm_cnt_lock); | 737 | spin_unlock_bh(&orig_node_tmp->ogm_cnt_lock); |
735 | 738 | ||
736 | orig_node_tmp = neigh_node->orig_node; | 739 | orig_node_tmp = neigh_node->orig_node; |
737 | spin_lock_bh(&orig_node_tmp->ogm_cnt_lock); | 740 | spin_lock_bh(&orig_node_tmp->ogm_cnt_lock); |
738 | bcast_own_sum_neigh = | 741 | sum_neigh = orig_node_tmp->bcast_own_sum[if_incoming->if_num]; |
739 | orig_node_tmp->bcast_own_sum[if_incoming->if_num]; | ||
740 | spin_unlock_bh(&orig_node_tmp->ogm_cnt_lock); | 742 | spin_unlock_bh(&orig_node_tmp->ogm_cnt_lock); |
741 | 743 | ||
742 | if (bcast_own_sum_orig >= bcast_own_sum_neigh) | 744 | if (sum_orig >= sum_neigh) |
743 | goto update_tt; | 745 | goto update_tt; |
744 | } | 746 | } |
745 | 747 | ||
@@ -912,6 +914,7 @@ batadv_iv_ogm_update_seqnos(const struct ethhdr *ethhdr, | |||
912 | int set_mark, ret = -1; | 914 | int set_mark, ret = -1; |
913 | uint32_t seqno = ntohl(batadv_ogm_packet->seqno); | 915 | uint32_t seqno = ntohl(batadv_ogm_packet->seqno); |
914 | uint8_t *neigh_addr; | 916 | uint8_t *neigh_addr; |
917 | uint8_t packet_count; | ||
915 | 918 | ||
916 | orig_node = batadv_get_orig_node(bat_priv, batadv_ogm_packet->orig); | 919 | orig_node = batadv_get_orig_node(bat_priv, batadv_ogm_packet->orig); |
917 | if (!orig_node) | 920 | if (!orig_node) |
@@ -946,9 +949,9 @@ batadv_iv_ogm_update_seqnos(const struct ethhdr *ethhdr, | |||
946 | tmp_neigh_node->real_bits, | 949 | tmp_neigh_node->real_bits, |
947 | seq_diff, set_mark); | 950 | seq_diff, set_mark); |
948 | 951 | ||
949 | tmp_neigh_node->real_packet_count = | 952 | packet_count = bitmap_weight(tmp_neigh_node->real_bits, |
950 | bitmap_weight(tmp_neigh_node->real_bits, | 953 | BATADV_TQ_LOCAL_WINDOW_SIZE); |
951 | BATADV_TQ_LOCAL_WINDOW_SIZE); | 954 | tmp_neigh_node->real_packet_count = packet_count; |
952 | } | 955 | } |
953 | rcu_read_unlock(); | 956 | rcu_read_unlock(); |
954 | 957 | ||