aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Chan <mchan@broadcom.com>2011-07-13 13:24:17 -0400
committerDavid S. Miller <davem@davemloft.net>2011-07-14 11:46:07 -0400
commit973e574e26cc8f4704e5d7f112fd566386e37f04 (patch)
treea0fb2a78b8089dca67b6bccca33c0c3864ac1c5d
parent10d1e8ca8d7136111641472e9800775205ef5a0f (diff)
cnic: Replace get_random_bytes() with random32()
Suggested by Stephen Hemminger <shemminger@vyatta.com> Signed-off-by: Michael Chan <mchan@broadcom.com> Reviewed-by: Matt Carlson <mcarlson@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--drivers/net/cnic.c5
1 files 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 @@
28#include <linux/ethtool.h> 28#include <linux/ethtool.h>
29#include <linux/if_vlan.h> 29#include <linux/if_vlan.h>
30#include <linux/prefetch.h> 30#include <linux/prefetch.h>
31#include <linux/random.h>
31#if defined(CONFIG_VLAN_8021Q) || defined(CONFIG_VLAN_8021Q_MODULE) 32#if defined(CONFIG_VLAN_8021Q) || defined(CONFIG_VLAN_8021Q_MODULE)
32#define BCM_VLAN 1 33#define BCM_VLAN 1
33#endif 34#endif
@@ -3830,7 +3831,7 @@ static int cnic_cm_alloc_mem(struct cnic_dev *dev)
3830 if (!cp->csk_tbl) 3831 if (!cp->csk_tbl)
3831 return -ENOMEM; 3832 return -ENOMEM;
3832 3833
3833 get_random_bytes(&port_id, sizeof(port_id)); 3834 port_id = random32();
3834 port_id %= CNIC_LOCAL_PORT_RANGE; 3835 port_id %= CNIC_LOCAL_PORT_RANGE;
3835 if (cnic_init_id_tbl(&cp->csk_port_tbl, CNIC_LOCAL_PORT_RANGE, 3836 if (cnic_init_id_tbl(&cp->csk_port_tbl, CNIC_LOCAL_PORT_RANGE,
3836 CNIC_LOCAL_PORT_MIN, port_id)) { 3837 CNIC_LOCAL_PORT_MIN, port_id)) {
@@ -3890,7 +3891,7 @@ static int cnic_cm_init_bnx2_hw(struct cnic_dev *dev)
3890{ 3891{
3891 u32 seed; 3892 u32 seed;
3892 3893
3893 get_random_bytes(&seed, 4); 3894 seed = random32();
3894 cnic_ctx_wr(dev, 45, 0, seed); 3895 cnic_ctx_wr(dev, 45, 0, seed);
3895 return 0; 3896 return 0;
3896} 3897}