public inbox for b.a.t.m.a.n@lists.open-mesh.org
 help / color / mirror / Atom feed
* [B.A.T.M.A.N.] [PATCH] batman-adv: use uint32_t instead of unsigned long to avoid cast
@ 2012-04-18  7:35 Antonio Quartulli
  2012-04-18  9:23 ` Marek Lindner
  0 siblings, 1 reply; 2+ messages in thread
From: Antonio Quartulli @ 2012-04-18  7:35 UTC (permalink / raw)
  To: b.a.t.m.a.n

Reported-by: David Miller <davem@davemloft.net>
Signed-off-by: Antonio Quartulli <ordex@autistici.org>
---

This patch is for *next*. It solves a problem pointed out by David S. Miller.
This patch will be squashed with the one which introduced the issue and will be
sent out in the next pull request.

Cheers,


 bat_iv_ogm.c |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/bat_iv_ogm.c b/bat_iv_ogm.c
index 994369d..ab2085c 100644
--- a/bat_iv_ogm.c
+++ b/bat_iv_ogm.c
@@ -58,12 +58,12 @@ out:
 static int bat_iv_ogm_iface_enable(struct hard_iface *hard_iface)
 {
 	struct batman_ogm_packet *batman_ogm_packet;
-	unsigned long random_seqno;
+	uint32_t random_seqno;
 	int res = -1;
 
 	/* randomize initial seqno to avoid collision */
-	get_random_bytes(&random_seqno, sizeof(unsigned long));
-	atomic_set(&hard_iface->seqno, (uint32_t)random_seqno);
+	get_random_bytes(&random_seqno, sizeof(random_seqno));
+	atomic_set(&hard_iface->seqno, random_seqno);
 
 	hard_iface->packet_len = BATMAN_OGM_HLEN;
 	hard_iface->packet_buff = kmalloc(hard_iface->packet_len, GFP_ATOMIC);
-- 
1.7.9.4


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2012-04-18  9:23 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-04-18  7:35 [B.A.T.M.A.N.] [PATCH] batman-adv: use uint32_t instead of unsigned long to avoid cast Antonio Quartulli
2012-04-18  9:23 ` Marek Lindner

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox