diff options
author | Akinobu Mita <akinobu.mita@gmail.com> | 2013-05-07 19:18:15 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2013-05-07 21:38:27 -0400 |
commit | e00adf39134028d65023c327b427074728c18f7e (patch) | |
tree | 22700d84954cc2cdf5c0ce8359422d642c3ca117 | |
parent | af73e4d9506d3b797509f3c030e7dcd554f7d9c4 (diff) |
drivers/net: rename random32() to prandom_u32()
Use preferable function name which implies using a pseudo-random number
generator.
[akpm@linux-foundation.org: convert team_mode_random.c]
Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
Acked-by: Thomas Sailer <t.sailer@alumni.ethz.ch>
Acked-by: Bing Zhao <bzhao@marvell.com> [mwifiex]
Cc: "David S. Miller" <davem@davemloft.net>
Cc: Michael Chan <mchan@broadcom.com>
Cc: Thomas Sailer <t.sailer@alumni.ethz.ch>
Cc: Jean-Paul Roubelat <jpr@f6fbb.org>
Cc: Bing Zhao <bzhao@marvell.com>
Cc: Brett Rudley <brudley@broadcom.com>
Cc: Arend van Spriel <arend@broadcom.com>
Cc: "Franky (Zhenhui) Lin" <frankyl@broadcom.com>
Cc: Hante Meuleman <meuleman@broadcom.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-rw-r--r-- | drivers/net/ethernet/broadcom/cnic.c | 4 | ||||
-rw-r--r-- | drivers/net/hamradio/baycom_epp.c | 2 | ||||
-rw-r--r-- | drivers/net/hamradio/hdlcdrv.c | 2 | ||||
-rw-r--r-- | drivers/net/hamradio/yam.c | 2 | ||||
-rw-r--r-- | drivers/net/team/team_mode_random.c | 2 | ||||
-rw-r--r-- | drivers/net/wireless/brcm80211/brcmfmac/p2p.c | 2 | ||||
-rw-r--r-- | drivers/net/wireless/mwifiex/cfg80211.c | 4 |
7 files changed, 9 insertions, 9 deletions
diff --git a/drivers/net/ethernet/broadcom/cnic.c b/drivers/net/ethernet/broadcom/cnic.c index 40649a8bf390..6b0dc131b20e 100644 --- a/drivers/net/ethernet/broadcom/cnic.c +++ b/drivers/net/ethernet/broadcom/cnic.c | |||
@@ -4085,7 +4085,7 @@ static int cnic_cm_alloc_mem(struct cnic_dev *dev) | |||
4085 | if (!cp->csk_tbl) | 4085 | if (!cp->csk_tbl) |
4086 | return -ENOMEM; | 4086 | return -ENOMEM; |
4087 | 4087 | ||
4088 | port_id = random32(); | 4088 | port_id = prandom_u32(); |
4089 | port_id %= CNIC_LOCAL_PORT_RANGE; | 4089 | port_id %= CNIC_LOCAL_PORT_RANGE; |
4090 | if (cnic_init_id_tbl(&cp->csk_port_tbl, CNIC_LOCAL_PORT_RANGE, | 4090 | if (cnic_init_id_tbl(&cp->csk_port_tbl, CNIC_LOCAL_PORT_RANGE, |
4091 | CNIC_LOCAL_PORT_MIN, port_id)) { | 4091 | CNIC_LOCAL_PORT_MIN, port_id)) { |
@@ -4145,7 +4145,7 @@ static int cnic_cm_init_bnx2_hw(struct cnic_dev *dev) | |||
4145 | { | 4145 | { |
4146 | u32 seed; | 4146 | u32 seed; |
4147 | 4147 | ||
4148 | seed = random32(); | 4148 | seed = prandom_u32(); |
4149 | cnic_ctx_wr(dev, 45, 0, seed); | 4149 | cnic_ctx_wr(dev, 45, 0, seed); |
4150 | return 0; | 4150 | return 0; |
4151 | } | 4151 | } |
diff --git a/drivers/net/hamradio/baycom_epp.c b/drivers/net/hamradio/baycom_epp.c index 49b8b58fc5c6..484f77ec2ce1 100644 --- a/drivers/net/hamradio/baycom_epp.c +++ b/drivers/net/hamradio/baycom_epp.c | |||
@@ -449,7 +449,7 @@ static int transmit(struct baycom_state *bc, int cnt, unsigned char stat) | |||
449 | if ((--bc->hdlctx.slotcnt) > 0) | 449 | if ((--bc->hdlctx.slotcnt) > 0) |
450 | return 0; | 450 | return 0; |
451 | bc->hdlctx.slotcnt = bc->ch_params.slottime; | 451 | bc->hdlctx.slotcnt = bc->ch_params.slottime; |
452 | if ((random32() % 256) > bc->ch_params.ppersist) | 452 | if ((prandom_u32() % 256) > bc->ch_params.ppersist) |
453 | return 0; | 453 | return 0; |
454 | } | 454 | } |
455 | } | 455 | } |
diff --git a/drivers/net/hamradio/hdlcdrv.c b/drivers/net/hamradio/hdlcdrv.c index a4a3516b6bbf..3169252613fa 100644 --- a/drivers/net/hamradio/hdlcdrv.c +++ b/drivers/net/hamradio/hdlcdrv.c | |||
@@ -389,7 +389,7 @@ void hdlcdrv_arbitrate(struct net_device *dev, struct hdlcdrv_state *s) | |||
389 | if ((--s->hdlctx.slotcnt) > 0) | 389 | if ((--s->hdlctx.slotcnt) > 0) |
390 | return; | 390 | return; |
391 | s->hdlctx.slotcnt = s->ch_params.slottime; | 391 | s->hdlctx.slotcnt = s->ch_params.slottime; |
392 | if ((random32() % 256) > s->ch_params.ppersist) | 392 | if ((prandom_u32() % 256) > s->ch_params.ppersist) |
393 | return; | 393 | return; |
394 | start_tx(dev, s); | 394 | start_tx(dev, s); |
395 | } | 395 | } |
diff --git a/drivers/net/hamradio/yam.c b/drivers/net/hamradio/yam.c index b2d863f2ea42..0721e72f9299 100644 --- a/drivers/net/hamradio/yam.c +++ b/drivers/net/hamradio/yam.c | |||
@@ -638,7 +638,7 @@ static void yam_arbitrate(struct net_device *dev) | |||
638 | yp->slotcnt = yp->slot / 10; | 638 | yp->slotcnt = yp->slot / 10; |
639 | 639 | ||
640 | /* is random > persist ? */ | 640 | /* is random > persist ? */ |
641 | if ((random32() % 256) > yp->pers) | 641 | if ((prandom_u32() % 256) > yp->pers) |
642 | return; | 642 | return; |
643 | 643 | ||
644 | yam_start_tx(dev, yp); | 644 | yam_start_tx(dev, yp); |
diff --git a/drivers/net/team/team_mode_random.c b/drivers/net/team/team_mode_random.c index 9eabfaa22f3e..5ca14d463ba7 100644 --- a/drivers/net/team/team_mode_random.c +++ b/drivers/net/team/team_mode_random.c | |||
@@ -18,7 +18,7 @@ | |||
18 | 18 | ||
19 | static u32 random_N(unsigned int N) | 19 | static u32 random_N(unsigned int N) |
20 | { | 20 | { |
21 | return reciprocal_divide(random32(), N); | 21 | return reciprocal_divide(prandom_u32(), N); |
22 | } | 22 | } |
23 | 23 | ||
24 | static bool rnd_transmit(struct team *team, struct sk_buff *skb) | 24 | static bool rnd_transmit(struct team *team, struct sk_buff *skb) |
diff --git a/drivers/net/wireless/brcm80211/brcmfmac/p2p.c b/drivers/net/wireless/brcm80211/brcmfmac/p2p.c index 2b90da0d85f3..e7a1a4770996 100644 --- a/drivers/net/wireless/brcm80211/brcmfmac/p2p.c +++ b/drivers/net/wireless/brcm80211/brcmfmac/p2p.c | |||
@@ -1117,7 +1117,7 @@ static void brcmf_p2p_afx_handler(struct work_struct *work) | |||
1117 | if (afx_hdl->is_listen && afx_hdl->my_listen_chan) | 1117 | if (afx_hdl->is_listen && afx_hdl->my_listen_chan) |
1118 | /* 100ms ~ 300ms */ | 1118 | /* 100ms ~ 300ms */ |
1119 | err = brcmf_p2p_discover_listen(p2p, afx_hdl->my_listen_chan, | 1119 | err = brcmf_p2p_discover_listen(p2p, afx_hdl->my_listen_chan, |
1120 | 100 * (1 + (random32() % 3))); | 1120 | 100 * (1 + prandom_u32() % 3)); |
1121 | else | 1121 | else |
1122 | err = brcmf_p2p_act_frm_search(p2p, afx_hdl->peer_listen_chan); | 1122 | err = brcmf_p2p_act_frm_search(p2p, afx_hdl->peer_listen_chan); |
1123 | 1123 | ||
diff --git a/drivers/net/wireless/mwifiex/cfg80211.c b/drivers/net/wireless/mwifiex/cfg80211.c index a0cb0770d319..d3c8ece980d8 100644 --- a/drivers/net/wireless/mwifiex/cfg80211.c +++ b/drivers/net/wireless/mwifiex/cfg80211.c | |||
@@ -216,7 +216,7 @@ mwifiex_cfg80211_mgmt_tx(struct wiphy *wiphy, struct wireless_dev *wdev, | |||
216 | mwifiex_form_mgmt_frame(skb, buf, len); | 216 | mwifiex_form_mgmt_frame(skb, buf, len); |
217 | mwifiex_queue_tx_pkt(priv, skb); | 217 | mwifiex_queue_tx_pkt(priv, skb); |
218 | 218 | ||
219 | *cookie = random32() | 1; | 219 | *cookie = prandom_u32() | 1; |
220 | cfg80211_mgmt_tx_status(wdev, *cookie, buf, len, true, GFP_ATOMIC); | 220 | cfg80211_mgmt_tx_status(wdev, *cookie, buf, len, true, GFP_ATOMIC); |
221 | 221 | ||
222 | wiphy_dbg(wiphy, "info: management frame transmitted\n"); | 222 | wiphy_dbg(wiphy, "info: management frame transmitted\n"); |
@@ -271,7 +271,7 @@ mwifiex_cfg80211_remain_on_channel(struct wiphy *wiphy, | |||
271 | duration); | 271 | duration); |
272 | 272 | ||
273 | if (!ret) { | 273 | if (!ret) { |
274 | *cookie = random32() | 1; | 274 | *cookie = prandom_u32() | 1; |
275 | priv->roc_cfg.cookie = *cookie; | 275 | priv->roc_cfg.cookie = *cookie; |
276 | priv->roc_cfg.chan = *chan; | 276 | priv->roc_cfg.chan = *chan; |
277 | 277 | ||