aboutsummaryrefslogtreecommitdiff
path: root/drivers/net/hamradio/baycom_epp.c
diff options
context:
space:
mode:
authorRalf Baechle <ralf@linux-mips.org>2007-02-16 11:55:33 +0000
committerJeff Garzik <jeff@garzik.org>2007-02-20 11:18:13 -0500
commit8b5b46718113166b5f6bcdf40e67ea867461e209 (patch)
treead0e8a3bb2ebd56938f4356e3daa608c481e0a20 /drivers/net/hamradio/baycom_epp.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/baycom_epp.c')
-rw-r--r--drivers/net/hamradio/baycom_epp.c13
1 files changed, 2 insertions, 11 deletions
diff --git a/drivers/net/hamradio/baycom_epp.c b/drivers/net/hamradio/baycom_epp.c
index 153b6dc80af..84aa2117c0e 100644
--- a/drivers/net/hamradio/baycom_epp.c
+++ b/drivers/net/hamradio/baycom_epp.c
@@ -52,6 +52,7 @@
#include <linux/hdlcdrv.h>
#include <linux/baycom.h>
#include <linux/jiffies.h>
+#include <linux/random.h>
#include <net/ax25.h>
#include <asm/uaccess.h>
@@ -433,16 +434,6 @@ static void encode_hdlc(struct baycom_state *bc)
/* ---------------------------------------------------------------------- */
-static unsigned short random_seed;
-
-static inline unsigned short random_num(void)
-{
- random_seed = 28629 * random_seed + 157;
- return random_seed;
-}
-
-/* ---------------------------------------------------------------------- */
-
static int transmit(struct baycom_state *bc, int cnt, unsigned char stat)
{
struct parport *pp = bc->pdev->port;
@@ -464,7 +455,7 @@ static int transmit(struct baycom_state *bc, int cnt, unsigned char stat)
if ((--bc->hdlctx.slotcnt) > 0)
return 0;
bc->hdlctx.slotcnt = bc->ch_params.slottime;
- if ((random_num() % 256) > bc->ch_params.ppersist)
+ if ((random32() % 256) > bc->ch_params.ppersist)
return 0;
}
}