diff options
author | Ralf Baechle <ralf@linux-mips.org> | 2007-02-16 06:55:33 -0500 |
---|---|---|
committer | Jeff Garzik <jeff@garzik.org> | 2007-02-20 11:18:13 -0500 |
commit | 8b5b46718113166b5f6bcdf40e67ea867461e209 (patch) | |
tree | ad0e8a3bb2ebd56938f4356e3daa608c481e0a20 /drivers/net/hamradio/baycom_epp.c | |
parent | 22747d6b41f31c71abc2b351bc9f6bfa6bae5d5e (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.c | 13 |
1 files changed, 2 insertions, 11 deletions
diff --git a/drivers/net/hamradio/baycom_epp.c b/drivers/net/hamradio/baycom_epp.c index 153b6dc80af4..84aa2117c0ee 100644 --- a/drivers/net/hamradio/baycom_epp.c +++ b/drivers/net/hamradio/baycom_epp.c | |||
@@ -52,6 +52,7 @@ | |||
52 | #include <linux/hdlcdrv.h> | 52 | #include <linux/hdlcdrv.h> |
53 | #include <linux/baycom.h> | 53 | #include <linux/baycom.h> |
54 | #include <linux/jiffies.h> | 54 | #include <linux/jiffies.h> |
55 | #include <linux/random.h> | ||
55 | #include <net/ax25.h> | 56 | #include <net/ax25.h> |
56 | #include <asm/uaccess.h> | 57 | #include <asm/uaccess.h> |
57 | 58 | ||
@@ -433,16 +434,6 @@ static void encode_hdlc(struct baycom_state *bc) | |||
433 | 434 | ||
434 | /* ---------------------------------------------------------------------- */ | 435 | /* ---------------------------------------------------------------------- */ |
435 | 436 | ||
436 | static unsigned short random_seed; | ||
437 | |||
438 | static inline unsigned short random_num(void) | ||
439 | { | ||
440 | random_seed = 28629 * random_seed + 157; | ||
441 | return random_seed; | ||
442 | } | ||
443 | |||
444 | /* ---------------------------------------------------------------------- */ | ||
445 | |||
446 | static int transmit(struct baycom_state *bc, int cnt, unsigned char stat) | 437 | static int transmit(struct baycom_state *bc, int cnt, unsigned char stat) |
447 | { | 438 | { |
448 | struct parport *pp = bc->pdev->port; | 439 | struct parport *pp = bc->pdev->port; |
@@ -464,7 +455,7 @@ static int transmit(struct baycom_state *bc, int cnt, unsigned char stat) | |||
464 | if ((--bc->hdlctx.slotcnt) > 0) | 455 | if ((--bc->hdlctx.slotcnt) > 0) |
465 | return 0; | 456 | return 0; |
466 | bc->hdlctx.slotcnt = bc->ch_params.slottime; | 457 | bc->hdlctx.slotcnt = bc->ch_params.slottime; |
467 | if ((random_num() % 256) > bc->ch_params.ppersist) | 458 | if ((random32() % 256) > bc->ch_params.ppersist) |
468 | return 0; | 459 | return 0; |
469 | } | 460 | } |
470 | } | 461 | } |