drivers/net: rename random32() to prandom_u32()
authorAkinobu Mita <akinobu.mita@gmail.com>
Tue, 7 May 2013 23:18:15 +0000 (16:18 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Wed, 8 May 2013 01:38:27 +0000 (18:38 -0700)
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>
drivers/net/ethernet/broadcom/cnic.c
drivers/net/hamradio/baycom_epp.c
drivers/net/hamradio/hdlcdrv.c
drivers/net/hamradio/yam.c
drivers/net/team/team_mode_random.c
drivers/net/wireless/brcm80211/brcmfmac/p2p.c
drivers/net/wireless/mwifiex/cfg80211.c

index 40649a8bf3901cb5d7e8a7037ad19aced910c55b..6b0dc131b20ea3fd057fdd8c1fa98243ecbdf42c 100644 (file)
@@ -4085,7 +4085,7 @@ static int cnic_cm_alloc_mem(struct cnic_dev *dev)
        if (!cp->csk_tbl)
                return -ENOMEM;
 
-       port_id = random32();
+       port_id = prandom_u32();
        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)) {
@@ -4145,7 +4145,7 @@ static int cnic_cm_init_bnx2_hw(struct cnic_dev *dev)
 {
        u32 seed;
 
-       seed = random32();
+       seed = prandom_u32();
        cnic_ctx_wr(dev, 45, 0, seed);
        return 0;
 }
index 49b8b58fc5c6f7823a9507ab2a0d75ab7d51dcac..484f77ec2ce1f439d21caad0656fc6d2924b1577 100644 (file)
@@ -449,7 +449,7 @@ static int transmit(struct baycom_state *bc, int cnt, unsigned char stat)
                        if ((--bc->hdlctx.slotcnt) > 0)
                                return 0;
                        bc->hdlctx.slotcnt = bc->ch_params.slottime;
-                       if ((random32() % 256) > bc->ch_params.ppersist)
+                       if ((prandom_u32() % 256) > bc->ch_params.ppersist)
                                return 0;
                }
        }
index a4a3516b6bbf87d05545a48d8e46627a5f81ee7c..3169252613faae400904201fa5ad9f1a7decf1cf 100644 (file)
@@ -389,7 +389,7 @@ void hdlcdrv_arbitrate(struct net_device *dev, struct hdlcdrv_state *s)
        if ((--s->hdlctx.slotcnt) > 0)
                return;
        s->hdlctx.slotcnt = s->ch_params.slottime;
-       if ((random32() % 256) > s->ch_params.ppersist)
+       if ((prandom_u32() % 256) > s->ch_params.ppersist)
                return;
        start_tx(dev, s);
 }
index b2d863f2ea4255a2f9cc61bda6a9fdff8ab5623c..0721e72f9299250c6c29f0e1d3f7f51affffe7e8 100644 (file)
@@ -638,7 +638,7 @@ static void yam_arbitrate(struct net_device *dev)
        yp->slotcnt = yp->slot / 10;
 
        /* is random > persist ? */
-       if ((random32() % 256) > yp->pers)
+       if ((prandom_u32() % 256) > yp->pers)
                return;
 
        yam_start_tx(dev, yp);
index 9eabfaa22f3e0eb7690806375d1f21f69ba618fe..5ca14d463ba7d897931b41b8c8f515a67ff9829c 100644 (file)
@@ -18,7 +18,7 @@
 
 static u32 random_N(unsigned int N)
 {
-       return reciprocal_divide(random32(), N);
+       return reciprocal_divide(prandom_u32(), N);
 }
 
 static bool rnd_transmit(struct team *team, struct sk_buff *skb)
index 2b90da0d85f3fcfb4e6ac7b0d6520b8e92bfa783..e7a1a47709966972891f96202996c77db40f3eec 100644 (file)
@@ -1117,7 +1117,7 @@ static void brcmf_p2p_afx_handler(struct work_struct *work)
        if (afx_hdl->is_listen && afx_hdl->my_listen_chan)
                /* 100ms ~ 300ms */
                err = brcmf_p2p_discover_listen(p2p, afx_hdl->my_listen_chan,
-                                               100 * (1 + (random32() % 3)));
+                                               100 * (1 + prandom_u32() % 3));
        else
                err = brcmf_p2p_act_frm_search(p2p, afx_hdl->peer_listen_chan);
 
index a0cb0770d319b9e407ac85aacc88dc7c958b1efb..d3c8ece980d8aa2394439f84348af73ce7ab94ff 100644 (file)
@@ -216,7 +216,7 @@ mwifiex_cfg80211_mgmt_tx(struct wiphy *wiphy, struct wireless_dev *wdev,
        mwifiex_form_mgmt_frame(skb, buf, len);
        mwifiex_queue_tx_pkt(priv, skb);
 
-       *cookie = random32() | 1;
+       *cookie = prandom_u32() | 1;
        cfg80211_mgmt_tx_status(wdev, *cookie, buf, len, true, GFP_ATOMIC);
 
        wiphy_dbg(wiphy, "info: management frame transmitted\n");
@@ -271,7 +271,7 @@ mwifiex_cfg80211_remain_on_channel(struct wiphy *wiphy,
                                         duration);
 
        if (!ret) {
-               *cookie = random32() | 1;
+               *cookie = prandom_u32() | 1;
                priv->roc_cfg.cookie = *cookie;
                priv->roc_cfg.chan = *chan;