public inbox for b.a.t.m.a.n@lists.open-mesh.org
 help / color / mirror / Atom feed
From: Antonio Quartulli <ordex@autistici.org>
To: b.a.t.m.a.n@lists.open-mesh.org
Subject: [B.A.T.M.A.N.] [PATCH] batman-adv: use uint32_t instead of unsigned long to avoid cast
Date: Wed, 18 Apr 2012 09:35:13 +0200	[thread overview]
Message-ID: <1334734513-30357-1-git-send-email-ordex@autistici.org> (raw)

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


             reply	other threads:[~2012-04-18  7:35 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-04-18  7:35 Antonio Quartulli [this message]
2012-04-18  9:23 ` [B.A.T.M.A.N.] [PATCH] batman-adv: use uint32_t instead of unsigned long to avoid cast Marek Lindner

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1334734513-30357-1-git-send-email-ordex@autistici.org \
    --to=ordex@autistici.org \
    --cc=b.a.t.m.a.n@lists.open-mesh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox