aboutsummaryrefslogtreecommitdiffstats
path: root/net/core
diff options
context:
space:
mode:
authorAruna-Hewapathirane <aruna.hewapathirane@gmail.com>2014-01-11 07:15:59 -0500
committerDavid S. Miller <davem@davemloft.net>2014-01-14 18:15:25 -0500
commit63862b5bef7349dd1137e4c70702c67d77565785 (patch)
treead50ec4a9d67fd025a29093dc5a4b493fe02e8a5 /net/core
parent825edac4e78ded9e621c167a4f47a2392bd9e082 (diff)
net: replace macros net_random and net_srandom with direct calls to prandom
This patch removes the net_random and net_srandom macros and replaces them with direct calls to the prandom ones. As new commits only seem to use prandom_u32 there is no use to keep them around. This change makes it easier to grep for users of prandom_u32. Signed-off-by: Aruna-Hewapathirane <aruna.hewapathirane@gmail.com> Suggested-by: Hannes Frederic Sowa <hannes@stressinduktion.org> Acked-by: Hannes Frederic Sowa <hannes@stressinduktion.org> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/core')
-rw-r--r--net/core/neighbour.c5
-rw-r--r--net/core/stream.c2
2 files changed, 4 insertions, 3 deletions
diff --git a/net/core/neighbour.c b/net/core/neighbour.c
index ea97361f0e9b..e360d9e65c04 100644
--- a/net/core/neighbour.c
+++ b/net/core/neighbour.c
@@ -117,7 +117,7 @@ static void neigh_cleanup_and_release(struct neighbour *neigh)
117 117
118unsigned long neigh_rand_reach_time(unsigned long base) 118unsigned long neigh_rand_reach_time(unsigned long base)
119{ 119{
120 return base ? (net_random() % base) + (base >> 1) : 0; 120 return base ? (prandom_u32() % base) + (base >> 1) : 0;
121} 121}
122EXPORT_SYMBOL(neigh_rand_reach_time); 122EXPORT_SYMBOL(neigh_rand_reach_time);
123 123
@@ -1415,7 +1415,8 @@ void pneigh_enqueue(struct neigh_table *tbl, struct neigh_parms *p,
1415 struct sk_buff *skb) 1415 struct sk_buff *skb)
1416{ 1416{
1417 unsigned long now = jiffies; 1417 unsigned long now = jiffies;
1418 unsigned long sched_next = now + (net_random() % 1418
1419 unsigned long sched_next = now + (prandom_u32() %
1419 NEIGH_VAR(p, PROXY_DELAY)); 1420 NEIGH_VAR(p, PROXY_DELAY));
1420 1421
1421 if (tbl->proxy_queue.qlen > NEIGH_VAR(p, PROXY_QLEN)) { 1422 if (tbl->proxy_queue.qlen > NEIGH_VAR(p, PROXY_QLEN)) {
diff --git a/net/core/stream.c b/net/core/stream.c
index 512f0a24269b..301c05f26060 100644
--- a/net/core/stream.c
+++ b/net/core/stream.c
@@ -122,7 +122,7 @@ int sk_stream_wait_memory(struct sock *sk, long *timeo_p)
122 DEFINE_WAIT(wait); 122 DEFINE_WAIT(wait);
123 123
124 if (sk_stream_memory_free(sk)) 124 if (sk_stream_memory_free(sk))
125 current_timeo = vm_wait = (net_random() % (HZ / 5)) + 2; 125 current_timeo = vm_wait = (prandom_u32() % (HZ / 5)) + 2;
126 126
127 while (1) { 127 while (1) {
128 set_bit(SOCK_ASYNC_NOSPACE, &sk->sk_socket->flags); 128 set_bit(SOCK_ASYNC_NOSPACE, &sk->sk_socket->flags);