diff options
author | Ralf Baechle <ralf@linux-mips.org> | 2007-02-16 11:55:33 +0000 |
---|---|---|
committer | Jeff Garzik <jeff@garzik.org> | 2007-02-20 11:18:13 -0500 |
commit | 8b5b46718113166b5f6bcdf40e67ea867461e209 (patch) | |
tree | ad0e8a3bb2ebd56938f4356e3daa608c481e0a20 /drivers/net/hamradio/yam.c | |
parent | 22747d6b41f31c71abc2b351bc9f6bfa6bae5d5e (diff) | |
download | op-kernel-dev-8b5b46718113166b5f6bcdf40e67ea867461e209.zip op-kernel-dev-8b5b46718113166b5f6bcdf40e67ea867461e209.tar.gz |
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/yam.c')
-rw-r--r-- | drivers/net/hamradio/yam.c | 11 |
1 files changed, 2 insertions, 9 deletions
diff --git a/drivers/net/hamradio/yam.c b/drivers/net/hamradio/yam.c index 08f2711..ee3ea4f 100644 --- a/drivers/net/hamradio/yam.c +++ b/drivers/net/hamradio/yam.c @@ -50,6 +50,7 @@ #include <linux/slab.h> #include <linux/errno.h> #include <linux/bitops.h> +#include <linux/random.h> #include <asm/io.h> #include <asm/system.h> #include <linux/interrupt.h> @@ -566,14 +567,6 @@ static void yam_start_tx(struct net_device *dev, struct yam_port *yp) ptt_on(dev); } -static unsigned short random_seed; - -static inline unsigned short random_num(void) -{ - random_seed = 28629 * random_seed + 157; - return random_seed; -} - static void yam_arbitrate(struct net_device *dev) { struct yam_port *yp = netdev_priv(dev); @@ -600,7 +593,7 @@ static void yam_arbitrate(struct net_device *dev) yp->slotcnt = yp->slot / 10; /* is random > persist ? */ - if ((random_num() % 256) > yp->pers) + if ((random32() % 256) > yp->pers) return; yam_start_tx(dev, yp); |