From 973e574e26cc8f4704e5d7f112fd566386e37f04 Mon Sep 17 00:00:00 2001 From: Michael Chan Date: Wed, 13 Jul 2011 17:24:17 +0000 Subject: [PATCH] cnic: Replace get_random_bytes() with random32() Suggested by Stephen Hemminger Signed-off-by: Michael Chan Reviewed-by: Matt Carlson Signed-off-by: David S. Miller --- drivers/net/cnic.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/net/cnic.c b/drivers/net/cnic.c index 5533b1526b1b..23d6108c64c6 100644 --- a/drivers/net/cnic.c +++ b/drivers/net/cnic.c @@ -28,6 +28,7 @@ #include #include #include +#include #if defined(CONFIG_VLAN_8021Q) || defined(CONFIG_VLAN_8021Q_MODULE) #define BCM_VLAN 1 #endif @@ -3830,7 +3831,7 @@ static int cnic_cm_alloc_mem(struct cnic_dev *dev) if (!cp->csk_tbl) return -ENOMEM; - get_random_bytes(&port_id, sizeof(port_id)); + port_id = random32(); port_id %= CNIC_LOCAL_PORT_RANGE; if (cnic_init_id_tbl(&cp->csk_port_tbl, CNIC_LOCAL_PORT_RANGE, CNIC_LOCAL_PORT_MIN, port_id)) { @@ -3890,7 +3891,7 @@ static int cnic_cm_init_bnx2_hw(struct cnic_dev *dev) { u32 seed; - get_random_bytes(&seed, 4); + seed = random32(); cnic_ctx_wr(dev, 45, 0, seed); return 0; } -- 2.30.2