From: Simon Wunderlich simon@open-mesh.com
Since the directlink variable was not needed anymore and was removed, more variables are now obsolete too, so remove them.
The directlink flag commit (which was obviously incomplete) was a0fc2f129f7193cbdd7e9c2e4da0d6e7ac15dd58 ("batman-adv: fix sparse warning in batadv_iv_ogm_emit"), which itself was a fix for 29b9256e6631876d4f1719f4d5e13d7ee140c61b ("batman-adv: consider outgoing interface in OGM sending").
Signed-off-by: Simon Wunderlich simon@open-mesh.com --- bat_iv_ogm.c | 5 ----- 1 file changed, 5 deletions(-)
diff --git a/bat_iv_ogm.c b/bat_iv_ogm.c index 92165cb..b9aec98 100644 --- a/bat_iv_ogm.c +++ b/bat_iv_ogm.c @@ -466,11 +466,6 @@ static void batadv_iv_ogm_emit(struct batadv_forw_packet *forw_packet) struct net_device *soft_iface; struct batadv_priv *bat_priv; struct batadv_hard_iface *primary_if = NULL; - struct batadv_ogm_packet *batadv_ogm_packet; - uint8_t *packet_pos; - - packet_pos = forw_packet->skb->data; - batadv_ogm_packet = (struct batadv_ogm_packet *)packet_pos;
if (!forw_packet->if_incoming) { pr_err("Error - can't forward packet: incoming iface not specified\n");
From: Simon Wunderlich simon@open-mesh.com
Introduced in my commit f13f960797fd1969b3c0470cc97435ddfb6aecb4 ("batman-adv: add debugfs support to view multiif tables")
Signed-off-by: Simon Wunderlich simon@open-mesh.com --- debugfs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/debugfs.c b/debugfs.c index cd5d24a..fcdb51b 100644 --- a/debugfs.c +++ b/debugfs.c @@ -252,7 +252,7 @@ static int batadv_originators_open(struct inode *inode, struct file *file) * @file: pointer to the seq_file */ static int batadv_originators_hardif_open(struct inode *inode, - struct file *file) + struct file *file) { struct net_device *net_dev = (struct net_device *)inode->i_private; return single_open(file, batadv_orig_hardif_seq_print_text, net_dev);
On Sunday 24 November 2013 14:05:44 Simon Wunderlich wrote:
From: Simon Wunderlich simon@open-mesh.com
Introduced in my commit f13f960797fd1969b3c0470cc97435ddfb6aecb4 ("batman-adv: add debugfs support to view multiif tables")
Signed-off-by: Simon Wunderlich simon@open-mesh.com
debugfs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Applied in revision dd51052.
Thanks, Marek
From: Simon Wunderlich simon@open-mesh.com
sparse complained about:
routing.c:482:64: error: incompatible types in comparison expression (different address spaces)
This was due to comparing a __rcu pointer with a regular one. Fix that by adding the missing rcu_dereference call. A temporary variable is used to comply with the line length limit, use the opportunity to beautify a few other places.
This problem was introduced in commit 797edd9e87ac838711e03498a4ae795b600191af ("batman-adv: add bonding again")
Signed-off-by: Simon Wunderlich simon@open-mesh.com --- routing.c | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-)
diff --git a/routing.c b/routing.c index 23311f5..7aac5b3 100644 --- a/routing.c +++ b/routing.c @@ -430,8 +430,10 @@ batadv_find_router(struct batadv_priv *bat_priv, struct batadv_neigh_node *first_candidate_router = NULL; struct batadv_neigh_node *next_candidate_router = NULL; struct batadv_neigh_node *router, *cand_router = NULL; + struct batadv_neigh_node *last_cand_router = NULL; struct batadv_orig_ifinfo *cand, *first_candidate = NULL; struct batadv_orig_ifinfo *next_candidate = NULL; + struct batadv_orig_ifinfo *last_candidate; bool last_candidate_found = false;
if (!orig_node) @@ -455,6 +457,10 @@ batadv_find_router(struct batadv_priv *bat_priv, * router - obviously there are no other candidates. */ rcu_read_lock(); + last_candidate = orig_node->last_bonding_candidate; + if (last_candidate) + last_cand_router = rcu_dereference(last_candidate->router); + hlist_for_each_entry_rcu(cand, &orig_node->ifinfo_list, list) { /* acquire some structures and references ... */ if (!atomic_inc_not_zero(&cand->refcount)) @@ -478,9 +484,8 @@ batadv_find_router(struct batadv_priv *bat_priv, goto next;
/* don't use the same router twice */ - if (orig_node->last_bonding_candidate && - (orig_node->last_bonding_candidate->router == cand_router)) - goto next; + if (last_cand_router == cand_router) + goto next;
/* mark the first possible candidate */ if (!first_candidate) { @@ -494,14 +499,13 @@ batadv_find_router(struct batadv_priv *bat_priv, * candidate ... this function should select the next candidate * AFTER the previously used bonding candidate. */ - if (!orig_node->last_bonding_candidate || - last_candidate_found) { + if (!last_candidate || last_candidate_found) { next_candidate = cand; next_candidate_router = cand_router; break; }
- if (orig_node->last_bonding_candidate == cand) + if (last_candidate == cand) last_candidate_found = true; next: /* free references */
On Sunday 24 November 2013 14:05:45 Simon Wunderlich wrote:
From: Simon Wunderlich simon@open-mesh.com
sparse complained about:
routing.c:482:64: error: incompatible types in comparison expression (different address spaces)
This was due to comparing a __rcu pointer with a regular one. Fix that by adding the missing rcu_dereference call. A temporary variable is used to comply with the line length limit, use the opportunity to beautify a few other places.
This problem was introduced in commit 797edd9e87ac838711e03498a4ae795b600191af ("batman-adv: add bonding again")
Signed-off-by: Simon Wunderlich simon@open-mesh.com
routing.c | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-)
Applied in revision f2a1300.
Thanks, Marek
On Sunday 24 November 2013 14:05:43 Simon Wunderlich wrote:
From: Simon Wunderlich simon@open-mesh.com
Since the directlink variable was not needed anymore and was removed, more variables are now obsolete too, so remove them.
The directlink flag commit (which was obviously incomplete) was a0fc2f129f7193cbdd7e9c2e4da0d6e7ac15dd58 ("batman-adv: fix sparse warning in batadv_iv_ogm_emit"), which itself was a fix for 29b9256e6631876d4f1719f4d5e13d7ee140c61b ("batman-adv: consider outgoing interface in OGM sending").
Signed-off-by: Simon Wunderlich simon@open-mesh.com
bat_iv_ogm.c | 5 ----- 1 file changed, 5 deletions(-)
Applied in revision 20978ca.
Thanks, Marek
b.a.t.m.a.n@lists.open-mesh.org