netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next 1/6] cnic: Replace get_random_bytes() with random32()
@ 2011-07-14  3:24 Michael Chan
  2011-07-14  3:24 ` [PATCH net-next 2/6] cnic: Fix port_mode setting Michael Chan
  2011-07-14 15:46 ` [PATCH net-next 1/6] cnic: Replace get_random_bytes() with random32() David Miller
  0 siblings, 2 replies; 12+ messages in thread
From: Michael Chan @ 2011-07-14  3:24 UTC (permalink / raw)
  To: davem; +Cc: netdev

Suggested by Stephen Hemminger <shemminger@vyatta.com>

Signed-off-by: Michael Chan <mchan@broadcom.com>
Reviewed-by: Matt Carlson <mcarlson@broadcom.com>
---
 drivers/net/cnic.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/net/cnic.c b/drivers/net/cnic.c
index 5533b15..23d6108 100644
--- a/drivers/net/cnic.c
+++ b/drivers/net/cnic.c
@@ -28,6 +28,7 @@
 #include <linux/ethtool.h>
 #include <linux/if_vlan.h>
 #include <linux/prefetch.h>
+#include <linux/random.h>
 #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;
 }
-- 
1.6.4.GIT



^ permalink raw reply related	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2011-07-14 15:46 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-07-14  3:24 [PATCH net-next 1/6] cnic: Replace get_random_bytes() with random32() Michael Chan
2011-07-14  3:24 ` [PATCH net-next 2/6] cnic: Fix port_mode setting Michael Chan
2011-07-14  3:24   ` [PATCH net-next 3/6] cnic: Fix ring setup/shutdown code Michael Chan
2011-07-14  3:24     ` [PATCH net-next 4/6] cnic: Return proper error code if we fail to send netlink message Michael Chan
2011-07-14  3:24       ` [PATCH net-next 5/6] bnx2: Add MCP dump Michael Chan
2011-07-14  3:24         ` [PATCH net-next 6/6] bnx2: Read iSCSI config from shared memory during ->probe() Michael Chan
2011-07-14 15:46           ` David Miller
2011-07-14 15:46         ` [PATCH net-next 5/6] bnx2: Add MCP dump David Miller
2011-07-14 15:46       ` [PATCH net-next 4/6] cnic: Return proper error code if we fail to send netlink message David Miller
2011-07-14 15:46     ` [PATCH net-next 3/6] cnic: Fix ring setup/shutdown code David Miller
2011-07-14 15:46   ` [PATCH net-next 2/6] cnic: Fix port_mode setting David Miller
2011-07-14 15:46 ` [PATCH net-next 1/6] cnic: Replace get_random_bytes() with random32() David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).