* [PATCH -v3 16/23] drivers/net: rename random32() to prandom_u32()
[not found] <1362401911-14074-1-git-send-email-akinobu.mita@gmail.com>
@ 2013-03-04 12:58 ` Akinobu Mita
[not found] ` <1362401911-14074-17-git-send-email-akinobu.mita-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2013-03-04 12:58 ` [PATCH -v3 17/23] net/sunrpc: " Akinobu Mita
` (5 subsequent siblings)
6 siblings, 1 reply; 10+ messages in thread
From: Akinobu Mita @ 2013-03-04 12:58 UTC (permalink / raw)
To: linux-kernel, akpm
Cc: Akinobu Mita, David S. Miller, Michael Chan, Thomas Sailer,
Jean-Paul Roubelat, Bing Zhao, Brett Rudley, Arend van Spriel,
Franky (Zhenhui) Lin, Hante Meuleman, brcm80211-dev-list, netdev,
linux-hams, linux-wireless
Use more preferable function name which implies using a pseudo-random
number generator.
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>
Cc: brcm80211-dev-list@broadcom.com
Cc: netdev@vger.kernel.org
Cc: linux-hams@vger.kernel.org
Cc: linux-wireless@vger.kernel.org
---
* Changes from v2
- add Acked-by: line
- add rename for brcm80211
drivers/net/ethernet/broadcom/cnic.c | 4 ++--
drivers/net/hamradio/baycom_epp.c | 2 +-
drivers/net/hamradio/hdlcdrv.c | 2 +-
drivers/net/hamradio/yam.c | 2 +-
drivers/net/wireless/brcm80211/brcmfmac/p2p.c | 2 +-
drivers/net/wireless/mwifiex/cfg80211.c | 4 ++--
6 files changed, 8 insertions(+), 8 deletions(-)
diff --git a/drivers/net/ethernet/broadcom/cnic.c b/drivers/net/ethernet/broadcom/cnic.c
index 149a3a0..5abdd48 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)
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;
}
diff --git a/drivers/net/hamradio/baycom_epp.c b/drivers/net/hamradio/baycom_epp.c
index 49b8b58..484f77e 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)
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;
}
}
diff --git a/drivers/net/hamradio/hdlcdrv.c b/drivers/net/hamradio/hdlcdrv.c
index a4a3516..3169252 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)
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);
}
diff --git a/drivers/net/hamradio/yam.c b/drivers/net/hamradio/yam.c
index 4cf8f10..ae3feb0 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)
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);
diff --git a/drivers/net/wireless/brcm80211/brcmfmac/p2p.c b/drivers/net/wireless/brcm80211/brcmfmac/p2p.c
index 4166e64..bca31a8 100644
--- a/drivers/net/wireless/brcm80211/brcmfmac/p2p.c
+++ b/drivers/net/wireless/brcm80211/brcmfmac/p2p.c
@@ -1118,7 +1118,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);
diff --git a/drivers/net/wireless/mwifiex/cfg80211.c b/drivers/net/wireless/mwifiex/cfg80211.c
index a44023a..4513707 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,
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;
--
1.8.1.2
^ permalink raw reply related [flat|nested] 10+ messages in thread
* [PATCH -v3 17/23] net/sunrpc: rename random32() to prandom_u32()
[not found] <1362401911-14074-1-git-send-email-akinobu.mita@gmail.com>
2013-03-04 12:58 ` [PATCH -v3 16/23] drivers/net: rename random32() to prandom_u32() Akinobu Mita
@ 2013-03-04 12:58 ` Akinobu Mita
2013-03-04 22:44 ` Myklebust, Trond
2013-03-04 12:58 ` [PATCH -v3 18/23] net/sched: " Akinobu Mita
` (4 subsequent siblings)
6 siblings, 1 reply; 10+ messages in thread
From: Akinobu Mita @ 2013-03-04 12:58 UTC (permalink / raw)
To: linux-kernel, akpm
Cc: Akinobu Mita, J. Bruce Fields, Trond Myklebust, David S. Miller,
netdev, linux-nfs
Use more preferable function name which implies using a pseudo-random
number generator.
Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
Cc: "J. Bruce Fields" <bfields@fieldses.org>
Cc: Trond Myklebust <Trond.Myklebust@netapp.com>
Cc: "David S. Miller" <davem@davemloft.net>
Cc: netdev@vger.kernel.org
Cc: linux-nfs@vger.kernel.org
---
No change from v2
net/sunrpc/auth_gss/gss_krb5_wrap.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/net/sunrpc/auth_gss/gss_krb5_wrap.c b/net/sunrpc/auth_gss/gss_krb5_wrap.c
index 88edec9..1da52d1 100644
--- a/net/sunrpc/auth_gss/gss_krb5_wrap.c
+++ b/net/sunrpc/auth_gss/gss_krb5_wrap.c
@@ -130,8 +130,8 @@ gss_krb5_make_confounder(char *p, u32 conflen)
/* initialize to random value */
if (i == 0) {
- i = random32();
- i = (i << 32) | random32();
+ i = prandom_u32();
+ i = (i << 32) | prandom_u32();
}
switch (conflen) {
--
1.8.1.2
^ permalink raw reply related [flat|nested] 10+ messages in thread
* [PATCH -v3 18/23] net/sched: rename random32() to prandom_u32()
[not found] <1362401911-14074-1-git-send-email-akinobu.mita@gmail.com>
2013-03-04 12:58 ` [PATCH -v3 16/23] drivers/net: rename random32() to prandom_u32() Akinobu Mita
2013-03-04 12:58 ` [PATCH -v3 17/23] net/sunrpc: " Akinobu Mita
@ 2013-03-04 12:58 ` Akinobu Mita
2013-03-04 12:58 ` [PATCH -v3 19/23] net/netfilter: " Akinobu Mita
` (3 subsequent siblings)
6 siblings, 0 replies; 10+ messages in thread
From: Akinobu Mita @ 2013-03-04 12:58 UTC (permalink / raw)
To: linux-kernel, akpm
Cc: Akinobu Mita, Stephen Hemminger, Jamal Hadi Salim,
David S. Miller, netem, netdev
Use more preferable function name which implies using a pseudo-random
number generator.
Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
Cc: Stephen Hemminger <shemminger@vyatta.com>
Cc: Jamal Hadi Salim <jhs@mojatatu.com>
Cc: "David S. Miller" <davem@davemloft.net>
Cc: netem@lists.linux-foundation.org
Cc: netdev@vger.kernel.org
Cc: netdev@vger.kernel.org
---
No change from v2
net/sched/sch_choke.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/net/sched/sch_choke.c b/net/sched/sch_choke.c
index cc37dd5..ef53ab8 100644
--- a/net/sched/sch_choke.c
+++ b/net/sched/sch_choke.c
@@ -80,7 +80,7 @@ struct choke_sched_data {
/* deliver a random number between 0 and N - 1 */
static u32 random_N(unsigned int N)
{
- return reciprocal_divide(random32(), N);
+ return reciprocal_divide(prandom_u32(), N);
}
/* number of elements in queue including holes */
--
1.8.1.2
^ permalink raw reply related [flat|nested] 10+ messages in thread
* [PATCH -v3 19/23] net/netfilter: rename random32() to prandom_u32()
[not found] <1362401911-14074-1-git-send-email-akinobu.mita@gmail.com>
` (2 preceding siblings ...)
2013-03-04 12:58 ` [PATCH -v3 18/23] net/sched: " Akinobu Mita
@ 2013-03-04 12:58 ` Akinobu Mita
2013-03-04 12:58 ` [PATCH -v3 20/23] net/core: " Akinobu Mita
` (2 subsequent siblings)
6 siblings, 0 replies; 10+ messages in thread
From: Akinobu Mita @ 2013-03-04 12:58 UTC (permalink / raw)
To: linux-kernel, akpm
Cc: Akinobu Mita, Pablo Neira Ayuso, Patrick McHardy,
netfilter-devel, netfilter, coreteam, David S. Miller, netdev
Use more preferable function name which implies using a pseudo-random
number generator.
Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
Cc: Pablo Neira Ayuso <pablo@netfilter.org>
Cc: Patrick McHardy <kaber@trash.net>
Cc: netfilter-devel@vger.kernel.org
Cc: netfilter@vger.kernel.org
Cc: coreteam@netfilter.org
Cc: "David S. Miller" <davem@davemloft.net>
Cc: netdev@vger.kernel.org
---
No change from v2
net/netfilter/nf_conntrack_core.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/net/netfilter/nf_conntrack_core.c b/net/netfilter/nf_conntrack_core.c
index c8e001a..f84965a 100644
--- a/net/netfilter/nf_conntrack_core.c
+++ b/net/netfilter/nf_conntrack_core.c
@@ -264,7 +264,7 @@ static void death_by_event(unsigned long ul_conntrack)
if (nf_conntrack_event(IPCT_DESTROY, ct) < 0) {
/* bad luck, let's retry again */
ecache->timeout.expires = jiffies +
- (random32() % net->ct.sysctl_events_retry_timeout);
+ (prandom_u32() % net->ct.sysctl_events_retry_timeout);
add_timer(&ecache->timeout);
return;
}
@@ -283,7 +283,7 @@ void nf_ct_dying_timeout(struct nf_conn *ct)
/* set a new timer to retry event delivery */
setup_timer(&ecache->timeout, death_by_event, (unsigned long)ct);
ecache->timeout.expires = jiffies +
- (random32() % net->ct.sysctl_events_retry_timeout);
+ (prandom_u32() % net->ct.sysctl_events_retry_timeout);
add_timer(&ecache->timeout);
}
EXPORT_SYMBOL_GPL(nf_ct_dying_timeout);
--
1.8.1.2
^ permalink raw reply related [flat|nested] 10+ messages in thread
* [PATCH -v3 20/23] net/core: rename random32() to prandom_u32()
[not found] <1362401911-14074-1-git-send-email-akinobu.mita@gmail.com>
` (3 preceding siblings ...)
2013-03-04 12:58 ` [PATCH -v3 19/23] net/netfilter: " Akinobu Mita
@ 2013-03-04 12:58 ` Akinobu Mita
2013-03-04 12:58 ` [PATCH -v3 21/23] net/core: remove duplicate statements by do-while loop Akinobu Mita
2013-03-04 12:58 ` [PATCH -v3 22/23] net: rename random32 to prandom Akinobu Mita
6 siblings, 0 replies; 10+ messages in thread
From: Akinobu Mita @ 2013-03-04 12:58 UTC (permalink / raw)
To: linux-kernel, akpm; +Cc: Akinobu Mita, David S. Miller, netdev
Use more preferable function name which implies using a pseudo-random
number generator.
Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
Cc: "David S. Miller" <davem@davemloft.net>
Cc: netdev@vger.kernel.org
---
No change from v2
net/core/pktgen.c | 29 +++++++++++++++--------------
1 file changed, 15 insertions(+), 14 deletions(-)
diff --git a/net/core/pktgen.c b/net/core/pktgen.c
index 6048fc1..4582275 100644
--- a/net/core/pktgen.c
+++ b/net/core/pktgen.c
@@ -2198,7 +2198,7 @@ static inline int f_pick(struct pktgen_dev *pkt_dev)
pkt_dev->curfl = 0; /*reset */
}
} else {
- flow = random32() % pkt_dev->cflows;
+ flow = prandom_u32() % pkt_dev->cflows;
pkt_dev->curfl = flow;
if (pkt_dev->flows[flow].count > pkt_dev->lflow) {
@@ -2246,7 +2246,7 @@ static void set_cur_queue_map(struct pktgen_dev *pkt_dev)
else if (pkt_dev->queue_map_min <= pkt_dev->queue_map_max) {
__u16 t;
if (pkt_dev->flags & F_QUEUE_MAP_RND) {
- t = random32() %
+ t = prandom_u32() %
(pkt_dev->queue_map_max -
pkt_dev->queue_map_min + 1)
+ pkt_dev->queue_map_min;
@@ -2278,7 +2278,7 @@ static void mod_cur_headers(struct pktgen_dev *pkt_dev)
__u32 tmp;
if (pkt_dev->flags & F_MACSRC_RND)
- mc = random32() % pkt_dev->src_mac_count;
+ mc = prandom_u32() % pkt_dev->src_mac_count;
else {
mc = pkt_dev->cur_src_mac_offset++;
if (pkt_dev->cur_src_mac_offset >=
@@ -2304,7 +2304,7 @@ static void mod_cur_headers(struct pktgen_dev *pkt_dev)
__u32 tmp;
if (pkt_dev->flags & F_MACDST_RND)
- mc = random32() % pkt_dev->dst_mac_count;
+ mc = prandom_u32() % pkt_dev->dst_mac_count;
else {
mc = pkt_dev->cur_dst_mac_offset++;
@@ -2331,21 +2331,21 @@ static void mod_cur_headers(struct pktgen_dev *pkt_dev)
for (i = 0; i < pkt_dev->nr_labels; i++)
if (pkt_dev->labels[i] & MPLS_STACK_BOTTOM)
pkt_dev->labels[i] = MPLS_STACK_BOTTOM |
- ((__force __be32)random32() &
+ ((__force __be32)prandom_u32() &
htonl(0x000fffff));
}
if ((pkt_dev->flags & F_VID_RND) && (pkt_dev->vlan_id != 0xffff)) {
- pkt_dev->vlan_id = random32() & (4096-1);
+ pkt_dev->vlan_id = prandom_u32() & (4096 - 1);
}
if ((pkt_dev->flags & F_SVID_RND) && (pkt_dev->svlan_id != 0xffff)) {
- pkt_dev->svlan_id = random32() & (4096 - 1);
+ pkt_dev->svlan_id = prandom_u32() & (4096 - 1);
}
if (pkt_dev->udp_src_min < pkt_dev->udp_src_max) {
if (pkt_dev->flags & F_UDPSRC_RND)
- pkt_dev->cur_udp_src = random32() %
+ pkt_dev->cur_udp_src = prandom_u32() %
(pkt_dev->udp_src_max - pkt_dev->udp_src_min)
+ pkt_dev->udp_src_min;
@@ -2358,7 +2358,7 @@ static void mod_cur_headers(struct pktgen_dev *pkt_dev)
if (pkt_dev->udp_dst_min < pkt_dev->udp_dst_max) {
if (pkt_dev->flags & F_UDPDST_RND) {
- pkt_dev->cur_udp_dst = random32() %
+ pkt_dev->cur_udp_dst = prandom_u32() %
(pkt_dev->udp_dst_max - pkt_dev->udp_dst_min)
+ pkt_dev->udp_dst_min;
} else {
@@ -2375,7 +2375,7 @@ static void mod_cur_headers(struct pktgen_dev *pkt_dev)
if (imn < imx) {
__u32 t;
if (pkt_dev->flags & F_IPSRC_RND)
- t = random32() % (imx - imn) + imn;
+ t = prandom_u32() % (imx - imn) + imn;
else {
t = ntohl(pkt_dev->cur_saddr);
t++;
@@ -2396,7 +2396,7 @@ static void mod_cur_headers(struct pktgen_dev *pkt_dev)
__be32 s;
if (pkt_dev->flags & F_IPDST_RND) {
- t = random32() % (imx - imn) + imn;
+ t = prandom_u32() % (imx - imn) + imn;
s = htonl(t);
while (ipv4_is_loopback(s) ||
@@ -2404,7 +2404,8 @@ static void mod_cur_headers(struct pktgen_dev *pkt_dev)
ipv4_is_lbcast(s) ||
ipv4_is_zeronet(s) ||
ipv4_is_local_multicast(s)) {
- t = random32() % (imx - imn) + imn;
+ t = prandom_u32() %
+ (imx - imn) + imn;
s = htonl(t);
}
pkt_dev->cur_daddr = s;
@@ -2437,7 +2438,7 @@ static void mod_cur_headers(struct pktgen_dev *pkt_dev)
for (i = 0; i < 4; i++) {
pkt_dev->cur_in6_daddr.s6_addr32[i] =
- (((__force __be32)random32() |
+ (((__force __be32)prandom_u32() |
pkt_dev->min_in6_daddr.s6_addr32[i]) &
pkt_dev->max_in6_daddr.s6_addr32[i]);
}
@@ -2447,7 +2448,7 @@ static void mod_cur_headers(struct pktgen_dev *pkt_dev)
if (pkt_dev->min_pkt_size < pkt_dev->max_pkt_size) {
__u32 t;
if (pkt_dev->flags & F_TXSIZE_RND) {
- t = random32() %
+ t = prandom_u32() %
(pkt_dev->max_pkt_size - pkt_dev->min_pkt_size)
+ pkt_dev->min_pkt_size;
} else {
--
1.8.1.2
^ permalink raw reply related [flat|nested] 10+ messages in thread
* [PATCH -v3 21/23] net/core: remove duplicate statements by do-while loop
[not found] <1362401911-14074-1-git-send-email-akinobu.mita@gmail.com>
` (4 preceding siblings ...)
2013-03-04 12:58 ` [PATCH -v3 20/23] net/core: " Akinobu Mita
@ 2013-03-04 12:58 ` Akinobu Mita
2013-03-04 12:58 ` [PATCH -v3 22/23] net: rename random32 to prandom Akinobu Mita
6 siblings, 0 replies; 10+ messages in thread
From: Akinobu Mita @ 2013-03-04 12:58 UTC (permalink / raw)
To: linux-kernel, akpm; +Cc: Akinobu Mita, David S. Miller, netdev
Remove duplicate statements by using do-while loop instead of while loop.
- A;
- while (e) {
+ do {
A;
- }
+ } while (e);
Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
Cc: "David S. Miller" <davem@davemloft.net>
Cc: netdev@vger.kernel.org
---
No change from v2
net/core/pktgen.c | 15 ++++++---------
1 file changed, 6 insertions(+), 9 deletions(-)
diff --git a/net/core/pktgen.c b/net/core/pktgen.c
index 4582275..5c21742 100644
--- a/net/core/pktgen.c
+++ b/net/core/pktgen.c
@@ -2396,18 +2396,15 @@ static void mod_cur_headers(struct pktgen_dev *pkt_dev)
__be32 s;
if (pkt_dev->flags & F_IPDST_RND) {
- t = prandom_u32() % (imx - imn) + imn;
- s = htonl(t);
-
- while (ipv4_is_loopback(s) ||
- ipv4_is_multicast(s) ||
- ipv4_is_lbcast(s) ||
- ipv4_is_zeronet(s) ||
- ipv4_is_local_multicast(s)) {
+ do {
t = prandom_u32() %
(imx - imn) + imn;
s = htonl(t);
- }
+ } while (ipv4_is_loopback(s) ||
+ ipv4_is_multicast(s) ||
+ ipv4_is_lbcast(s) ||
+ ipv4_is_zeronet(s) ||
+ ipv4_is_local_multicast(s));
pkt_dev->cur_daddr = s;
} else {
t = ntohl(pkt_dev->cur_daddr);
--
1.8.1.2
^ permalink raw reply related [flat|nested] 10+ messages in thread
* [PATCH -v3 22/23] net: rename random32 to prandom
[not found] <1362401911-14074-1-git-send-email-akinobu.mita@gmail.com>
` (5 preceding siblings ...)
2013-03-04 12:58 ` [PATCH -v3 21/23] net/core: remove duplicate statements by do-while loop Akinobu Mita
@ 2013-03-04 12:58 ` Akinobu Mita
6 siblings, 0 replies; 10+ messages in thread
From: Akinobu Mita @ 2013-03-04 12:58 UTC (permalink / raw)
To: linux-kernel, akpm; +Cc: Akinobu Mita, David S. Miller, netdev
Commit 496f2f93b1cc286f5a4f4f9acdc1e5314978683f ("random32: rename
random32 to prandom") renamed random32() and srandom32() to prandom_u32()
and prandom_seed() respectively.
net_random() and net_srandom() need to be redefined with prandom_* in
order to finish the naming transition.
While I'm at it, enclose macro argument of net_srandom() with parenthesis.
Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
Cc: "David S. Miller" <davem@davemloft.net>
Cc: netdev@vger.kernel.org
---
No change from v2
include/linux/net.h | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/include/linux/net.h b/include/linux/net.h
index aa16731..99c9f0c 100644
--- a/include/linux/net.h
+++ b/include/linux/net.h
@@ -240,8 +240,8 @@ do { \
#define net_dbg_ratelimited(fmt, ...) \
net_ratelimited_function(pr_debug, fmt, ##__VA_ARGS__)
-#define net_random() random32()
-#define net_srandom(seed) srandom32((__force u32)seed)
+#define net_random() prandom_u32()
+#define net_srandom(seed) prandom_seed((__force u32)(seed))
extern int kernel_sendmsg(struct socket *sock, struct msghdr *msg,
struct kvec *vec, size_t num, size_t len);
--
1.8.1.2
^ permalink raw reply related [flat|nested] 10+ messages in thread
* Re: [PATCH -v3 16/23] drivers/net: rename random32() to prandom_u32()
[not found] ` <1362401911-14074-17-git-send-email-akinobu.mita-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
@ 2013-03-04 13:37 ` Arend van Spriel
2013-03-04 21:53 ` Akinobu Mita
0 siblings, 1 reply; 10+ messages in thread
From: Arend van Spriel @ 2013-03-04 13:37 UTC (permalink / raw)
To: Akinobu Mita
Cc: linux-kernel-u79uwXL29TY76Z2rM5mHXA,
akpm-de/tnXTf+JLsfHDXvbKv3WD2FQJk+8+b, David S. Miller,
Michael Chan, Thomas Sailer, Jean-Paul Roubelat, Bing Zhao,
Brett Rudley, Franky (Zhenhui) Lin, Hante Meuleman,
brcm80211-dev-list-dY08KVG/lbpWk0Htik3J/w,
netdev-u79uwXL29TY76Z2rM5mHXA, linux-hams-u79uwXL29TY76Z2rM5mHXA,
linux-wireless-u79uwXL29TY76Z2rM5mHXA
On 03/04/13 13:58, Akinobu Mita wrote:
> Use more preferable function name which implies using a pseudo-random
> number generator.
>
> Signed-off-by: Akinobu Mita<akinobu.mita-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
> Acked-by: Thomas Sailer<t.sailer-aAjG49QhEdKVRmA6MYkXiA@public.gmane.org>
> Acked-by: Bing Zhao<bzhao-eYqpPyKDWXRBDgjK7y7TUQ@public.gmane.org> [mwifiex]
> Cc: "David S. Miller"<davem-fT/PcQaiUtIeIZ0/mPfg9Q@public.gmane.org>
> Cc: Michael Chan<mchan-dY08KVG/lbpWk0Htik3J/w@public.gmane.org>
> Cc: Thomas Sailer<t.sailer-aAjG49QhEdKVRmA6MYkXiA@public.gmane.org>
> Cc: Jean-Paul Roubelat<jpr-3OwtVqItl4LYtjvyW6yDsg@public.gmane.org>
> Cc: Bing Zhao<bzhao-eYqpPyKDWXRBDgjK7y7TUQ@public.gmane.org>
> Cc: Brett Rudley<brudley-dY08KVG/lbpWk0Htik3J/w@public.gmane.org>
> Cc: Arend van Spriel<arend-dY08KVG/lbpWk0Htik3J/w@public.gmane.org>
> Cc: "Franky (Zhenhui) Lin"<frankyl-dY08KVG/lbpWk0Htik3J/w@public.gmane.org>
> Cc: Hante Meuleman<meuleman-dY08KVG/lbpWk0Htik3J/w@public.gmane.org>
> Cc: brcm80211-dev-list-dY08KVG/lbpWk0Htik3J/w@public.gmane.org
> Cc: netdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
> Cc: linux-hams-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
> Cc: linux-wireless-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
> ---
> * Changes from v2
> - add Acked-by: line
> - add rename for brcm80211
>
> drivers/net/ethernet/broadcom/cnic.c | 4 ++--
> drivers/net/hamradio/baycom_epp.c | 2 +-
> drivers/net/hamradio/hdlcdrv.c | 2 +-
> drivers/net/hamradio/yam.c | 2 +-
> drivers/net/wireless/brcm80211/brcmfmac/p2p.c | 2 +-
> drivers/net/wireless/mwifiex/cfg80211.c | 4 ++--
> 6 files changed, 8 insertions(+), 8 deletions(-)
>
> diff --git a/drivers/net/wireless/brcm80211/brcmfmac/p2p.c b/drivers/net/wireless/brcm80211/brcmfmac/p2p.c
> index 4166e64..bca31a8 100644
> --- a/drivers/net/wireless/brcm80211/brcmfmac/p2p.c
> +++ b/drivers/net/wireless/brcm80211/brcmfmac/p2p.c
> @@ -1118,7 +1118,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)));
Seems like indentation is wrong now. Please retain the alignment.
Regards,
Arend
--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH -v3 16/23] drivers/net: rename random32() to prandom_u32()
2013-03-04 13:37 ` Arend van Spriel
@ 2013-03-04 21:53 ` Akinobu Mita
0 siblings, 0 replies; 10+ messages in thread
From: Akinobu Mita @ 2013-03-04 21:53 UTC (permalink / raw)
To: Arend van Spriel
Cc: LKML, Andrew Morton, David S. Miller, Michael Chan,
Thomas Sailer, Jean-Paul Roubelat, Bing Zhao, Brett Rudley,
Franky (Zhenhui) Lin, Hante Meuleman, brcm80211-dev-list, netdev,
linux-hams, linux-wireless
2013/3/4 Arend van Spriel <arend@broadcom.com>
>>
>> @@ -1118,7 +1118,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)));
>
>
> Seems like indentation is wrong now. Please retain the alignment.
OK, I'll fix it.
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH -v3 17/23] net/sunrpc: rename random32() to prandom_u32()
2013-03-04 12:58 ` [PATCH -v3 17/23] net/sunrpc: " Akinobu Mita
@ 2013-03-04 22:44 ` Myklebust, Trond
0 siblings, 0 replies; 10+ messages in thread
From: Myklebust, Trond @ 2013-03-04 22:44 UTC (permalink / raw)
To: Akinobu Mita
Cc: linux-kernel, akpm, J. Bruce Fields, David S. Miller, netdev, linux-nfs
[-- Attachment #1: Type: text/plain, Size: 1118 bytes --]
On Mon, 2013-03-04 at 21:58 +0900, Akinobu Mita wrote:
> Use more preferable function name which implies using a pseudo-random
> number generator.
>
> Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
> Cc: "J. Bruce Fields" <bfields@fieldses.org>
> Cc: Trond Myklebust <Trond.Myklebust@netapp.com>
> Cc: "David S. Miller" <davem@davemloft.net>
> Cc: netdev@vger.kernel.org
> Cc: linux-nfs@vger.kernel.org
> ---
>
> No change from v2
>
> net/sunrpc/auth_gss/gss_krb5_wrap.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/net/sunrpc/auth_gss/gss_krb5_wrap.c b/net/sunrpc/auth_gss/gss_krb5_wrap.c
> index 88edec9..1da52d1 100644
> --- a/net/sunrpc/auth_gss/gss_krb5_wrap.c
> +++ b/net/sunrpc/auth_gss/gss_krb5_wrap.c
> @@ -130,8 +130,8 @@ gss_krb5_make_confounder(char *p, u32 conflen)
>
> /* initialize to random value */
> if (i == 0) {
> - i = random32();
> - i = (i << 32) | random32();
> + i = prandom_u32();
> + i = (i << 32) | prandom_u32();
> }
>
> switch (conflen) {
Acked-by: Trond Myklebust <Trond.Myklebust@netapp.com>
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 836 bytes --]
^ permalink raw reply [flat|nested] 10+ messages in thread
end of thread, other threads:[~2013-03-04 22:44 UTC | newest]
Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
[not found] <1362401911-14074-1-git-send-email-akinobu.mita@gmail.com>
2013-03-04 12:58 ` [PATCH -v3 16/23] drivers/net: rename random32() to prandom_u32() Akinobu Mita
[not found] ` <1362401911-14074-17-git-send-email-akinobu.mita-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2013-03-04 13:37 ` Arend van Spriel
2013-03-04 21:53 ` Akinobu Mita
2013-03-04 12:58 ` [PATCH -v3 17/23] net/sunrpc: " Akinobu Mita
2013-03-04 22:44 ` Myklebust, Trond
2013-03-04 12:58 ` [PATCH -v3 18/23] net/sched: " Akinobu Mita
2013-03-04 12:58 ` [PATCH -v3 19/23] net/netfilter: " Akinobu Mita
2013-03-04 12:58 ` [PATCH -v3 20/23] net/core: " Akinobu Mita
2013-03-04 12:58 ` [PATCH -v3 21/23] net/core: remove duplicate statements by do-while loop Akinobu Mita
2013-03-04 12:58 ` [PATCH -v3 22/23] net: rename random32 to prandom Akinobu Mita
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).