aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/hamradio/hdlcdrv.c
diff options
context:
space:
mode:
authorRalf Baechle <ralf@linux-mips.org>2007-02-16 06:55:33 -0500
committerJeff Garzik <jeff@garzik.org>2007-02-20 11:18:13 -0500
commit8b5b46718113166b5f6bcdf40e67ea867461e209 (patch)
treead0e8a3bb2ebd56938f4356e3daa608c481e0a20 /drivers/net/hamradio/hdlcdrv.c
parent22747d6b41f31c71abc2b351bc9f6bfa6bae5d5e (diff)
Replace local random function with random32()
Signed-off-by: Joe Perches <joe@perches.com> Signed-off-by: Ralf Baechle <ralf@linux-mips.org> Signed-off-by: Jeff Garzik <jeff@garzik.org>
Diffstat (limited to 'drivers/net/hamradio/hdlcdrv.c')
-rw-r--r--drivers/net/hamradio/hdlcdrv.c13
1 files changed, 2 insertions, 11 deletions
diff --git a/drivers/net/hamradio/hdlcdrv.c b/drivers/net/hamradio/hdlcdrv.c
index 452873e7c68..f5a17ad9d3d 100644
--- a/drivers/net/hamradio/hdlcdrv.c
+++ b/drivers/net/hamradio/hdlcdrv.c
@@ -56,6 +56,7 @@
56#include <linux/if_arp.h> 56#include <linux/if_arp.h>
57#include <linux/skbuff.h> 57#include <linux/skbuff.h>
58#include <linux/hdlcdrv.h> 58#include <linux/hdlcdrv.h>
59#include <linux/random.h>
59#include <net/ax25.h> 60#include <net/ax25.h>
60#include <asm/uaccess.h> 61#include <asm/uaccess.h>
61 62
@@ -371,16 +372,6 @@ static void start_tx(struct net_device *dev, struct hdlcdrv_state *s)
371 372
372/* ---------------------------------------------------------------------- */ 373/* ---------------------------------------------------------------------- */
373 374
374static unsigned short random_seed;
375
376static inline unsigned short random_num(void)
377{
378 random_seed = 28629 * random_seed + 157;
379 return random_seed;
380}
381
382/* ---------------------------------------------------------------------- */
383
384void hdlcdrv_arbitrate(struct net_device *dev, struct hdlcdrv_state *s) 375void hdlcdrv_arbitrate(struct net_device *dev, struct hdlcdrv_state *s)
385{ 376{
386 if (!s || s->magic != HDLCDRV_MAGIC || s->hdlctx.ptt || !s->skb) 377 if (!s || s->magic != HDLCDRV_MAGIC || s->hdlctx.ptt || !s->skb)
@@ -396,7 +387,7 @@ void hdlcdrv_arbitrate(struct net_device *dev, struct hdlcdrv_state *s)
396 if ((--s->hdlctx.slotcnt) > 0) 387 if ((--s->hdlctx.slotcnt) > 0)
397 return; 388 return;
398 s->hdlctx.slotcnt = s->ch_params.slottime; 389 s->hdlctx.slotcnt = s->ch_params.slottime;
399 if ((random_num() % 256) > s->ch_params.ppersist) 390 if ((random32() % 256) > s->ch_params.ppersist)
400 return; 391 return;
401 start_tx(dev, s); 392 start_tx(dev, s);
402} 393}