* [B.A.T.M.A.N.] [PATCH 1/3] batman-adv: fix another sparse warning in batadv_iv_ogm_emit
@ 2013-11-24 13:05 Simon Wunderlich
2013-11-24 13:05 ` [B.A.T.M.A.N.] [PATCH 2/3] batman-adv: fix wrong alignment for batadv_originators_hardif_open Simon Wunderlich
` (2 more replies)
0 siblings, 3 replies; 6+ messages in thread
From: Simon Wunderlich @ 2013-11-24 13:05 UTC (permalink / raw)
To: b.a.t.m.a.n; +Cc: Simon Wunderlich
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");
--
1.7.10.4
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [B.A.T.M.A.N.] [PATCH 2/3] batman-adv: fix wrong alignment for batadv_originators_hardif_open
2013-11-24 13:05 [B.A.T.M.A.N.] [PATCH 1/3] batman-adv: fix another sparse warning in batadv_iv_ogm_emit Simon Wunderlich
@ 2013-11-24 13:05 ` Simon Wunderlich
2013-11-25 17:49 ` Marek Lindner
2013-11-24 13:05 ` [B.A.T.M.A.N.] [PATCH 3/3] batman-adv: fix rcu pointer comparison problem Simon Wunderlich
2013-11-25 17:48 ` [B.A.T.M.A.N.] [PATCH 1/3] batman-adv: fix another sparse warning in batadv_iv_ogm_emit Marek Lindner
2 siblings, 1 reply; 6+ messages in thread
From: Simon Wunderlich @ 2013-11-24 13:05 UTC (permalink / raw)
To: b.a.t.m.a.n; +Cc: Simon Wunderlich
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);
--
1.7.10.4
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [B.A.T.M.A.N.] [PATCH 3/3] batman-adv: fix rcu pointer comparison problem
2013-11-24 13:05 [B.A.T.M.A.N.] [PATCH 1/3] batman-adv: fix another sparse warning in batadv_iv_ogm_emit Simon Wunderlich
2013-11-24 13:05 ` [B.A.T.M.A.N.] [PATCH 2/3] batman-adv: fix wrong alignment for batadv_originators_hardif_open Simon Wunderlich
@ 2013-11-24 13:05 ` Simon Wunderlich
2013-11-25 17:51 ` Marek Lindner
2013-11-25 17:48 ` [B.A.T.M.A.N.] [PATCH 1/3] batman-adv: fix another sparse warning in batadv_iv_ogm_emit Marek Lindner
2 siblings, 1 reply; 6+ messages in thread
From: Simon Wunderlich @ 2013-11-24 13:05 UTC (permalink / raw)
To: b.a.t.m.a.n; +Cc: Simon Wunderlich
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 */
--
1.7.10.4
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [B.A.T.M.A.N.] [PATCH 1/3] batman-adv: fix another sparse warning in batadv_iv_ogm_emit
2013-11-24 13:05 [B.A.T.M.A.N.] [PATCH 1/3] batman-adv: fix another sparse warning in batadv_iv_ogm_emit Simon Wunderlich
2013-11-24 13:05 ` [B.A.T.M.A.N.] [PATCH 2/3] batman-adv: fix wrong alignment for batadv_originators_hardif_open Simon Wunderlich
2013-11-24 13:05 ` [B.A.T.M.A.N.] [PATCH 3/3] batman-adv: fix rcu pointer comparison problem Simon Wunderlich
@ 2013-11-25 17:48 ` Marek Lindner
2 siblings, 0 replies; 6+ messages in thread
From: Marek Lindner @ 2013-11-25 17:48 UTC (permalink / raw)
To: b.a.t.m.a.n; +Cc: Simon Wunderlich
[-- Attachment #1: Type: text/plain, Size: 714 bytes --]
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
[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 490 bytes --]
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [B.A.T.M.A.N.] [PATCH 2/3] batman-adv: fix wrong alignment for batadv_originators_hardif_open
2013-11-24 13:05 ` [B.A.T.M.A.N.] [PATCH 2/3] batman-adv: fix wrong alignment for batadv_originators_hardif_open Simon Wunderlich
@ 2013-11-25 17:49 ` Marek Lindner
0 siblings, 0 replies; 6+ messages in thread
From: Marek Lindner @ 2013-11-25 17:49 UTC (permalink / raw)
To: b.a.t.m.a.n; +Cc: Simon Wunderlich
[-- Attachment #1: Type: text/plain, Size: 420 bytes --]
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
[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 490 bytes --]
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [B.A.T.M.A.N.] [PATCH 3/3] batman-adv: fix rcu pointer comparison problem
2013-11-24 13:05 ` [B.A.T.M.A.N.] [PATCH 3/3] batman-adv: fix rcu pointer comparison problem Simon Wunderlich
@ 2013-11-25 17:51 ` Marek Lindner
0 siblings, 0 replies; 6+ messages in thread
From: Marek Lindner @ 2013-11-25 17:51 UTC (permalink / raw)
To: b.a.t.m.a.n; +Cc: Simon Wunderlich
[-- Attachment #1: Type: text/plain, Size: 806 bytes --]
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
[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 490 bytes --]
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2013-11-25 17:51 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-11-24 13:05 [B.A.T.M.A.N.] [PATCH 1/3] batman-adv: fix another sparse warning in batadv_iv_ogm_emit Simon Wunderlich
2013-11-24 13:05 ` [B.A.T.M.A.N.] [PATCH 2/3] batman-adv: fix wrong alignment for batadv_originators_hardif_open Simon Wunderlich
2013-11-25 17:49 ` Marek Lindner
2013-11-24 13:05 ` [B.A.T.M.A.N.] [PATCH 3/3] batman-adv: fix rcu pointer comparison problem Simon Wunderlich
2013-11-25 17:51 ` Marek Lindner
2013-11-25 17:48 ` [B.A.T.M.A.N.] [PATCH 1/3] batman-adv: fix another sparse warning in batadv_iv_ogm_emit Marek Lindner
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox