summaryrefslogtreecommitdiffstats
path: root/drivers/net/hamradio/hdlcdrv.c
diff options
context:
space:
mode:
authorRalf Baechle <ralf@linux-mips.org>2007-02-16 12:55:33 +0100
committerJeff Garzik <jeff@garzik.org>2007-02-20 17:18:13 +0100
commit8b5b46718113166b5f6bcdf40e67ea867461e209 (patch)
treead0e8a3bb2ebd56938f4356e3daa608c481e0a20 /drivers/net/hamradio/hdlcdrv.c
parents2io: RTNL and flush_scheduled_work deadlock (diff)
downloadlinux-8b5b46718113166b5f6bcdf40e67ea867461e209.tar.xz
linux-8b5b46718113166b5f6bcdf40e67ea867461e209.zip
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 452873e7c68f..f5a17ad9d3d6 100644
--- a/drivers/net/hamradio/hdlcdrv.c
+++ b/drivers/net/hamradio/hdlcdrv.c
@@ -56,6 +56,7 @@
#include <linux/if_arp.h>
#include <linux/skbuff.h>
#include <linux/hdlcdrv.h>
+#include <linux/random.h>
#include <net/ax25.h>
#include <asm/uaccess.h>
@@ -371,16 +372,6 @@ static void start_tx(struct net_device *dev, struct hdlcdrv_state *s)
/* ---------------------------------------------------------------------- */
-static unsigned short random_seed;
-
-static inline unsigned short random_num(void)
-{
- random_seed = 28629 * random_seed + 157;
- return random_seed;
-}
-
-/* ---------------------------------------------------------------------- */
-
void hdlcdrv_arbitrate(struct net_device *dev, struct hdlcdrv_state *s)
{
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)
if ((--s->hdlctx.slotcnt) > 0)
return;
s->hdlctx.slotcnt = s->ch_params.slottime;
- if ((random_num() % 256) > s->ch_params.ppersist)
+ if ((random32() % 256) > s->ch_params.ppersist)
return;
start_tx(dev, s);
}