diff options
author | Aruna-Hewapathirane <aruna.hewapathirane@gmail.com> | 2014-01-11 07:15:59 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2014-01-14 18:15:25 -0500 |
commit | 63862b5bef7349dd1137e4c70702c67d77565785 (patch) | |
tree | ad50ec4a9d67fd025a29093dc5a4b493fe02e8a5 /net/ipv6/mcast.c | |
parent | 825edac4e78ded9e621c167a4f47a2392bd9e082 (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/ipv6/mcast.c')
-rw-r--r-- | net/ipv6/mcast.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/net/ipv6/mcast.c b/net/ipv6/mcast.c index d18f9f903db6..7ff82b3e54b6 100644 --- a/net/ipv6/mcast.c +++ b/net/ipv6/mcast.c | |||
@@ -999,7 +999,7 @@ bool ipv6_chk_mcast_addr(struct net_device *dev, const struct in6_addr *group, | |||
999 | 999 | ||
1000 | static void mld_gq_start_timer(struct inet6_dev *idev) | 1000 | static void mld_gq_start_timer(struct inet6_dev *idev) |
1001 | { | 1001 | { |
1002 | unsigned long tv = net_random() % idev->mc_maxdelay; | 1002 | unsigned long tv = prandom_u32() % idev->mc_maxdelay; |
1003 | 1003 | ||
1004 | idev->mc_gq_running = 1; | 1004 | idev->mc_gq_running = 1; |
1005 | if (!mod_timer(&idev->mc_gq_timer, jiffies+tv+2)) | 1005 | if (!mod_timer(&idev->mc_gq_timer, jiffies+tv+2)) |
@@ -1015,7 +1015,7 @@ static void mld_gq_stop_timer(struct inet6_dev *idev) | |||
1015 | 1015 | ||
1016 | static void mld_ifc_start_timer(struct inet6_dev *idev, unsigned long delay) | 1016 | static void mld_ifc_start_timer(struct inet6_dev *idev, unsigned long delay) |
1017 | { | 1017 | { |
1018 | unsigned long tv = net_random() % delay; | 1018 | unsigned long tv = prandom_u32() % delay; |
1019 | 1019 | ||
1020 | if (!mod_timer(&idev->mc_ifc_timer, jiffies+tv+2)) | 1020 | if (!mod_timer(&idev->mc_ifc_timer, jiffies+tv+2)) |
1021 | in6_dev_hold(idev); | 1021 | in6_dev_hold(idev); |
@@ -1030,7 +1030,7 @@ static void mld_ifc_stop_timer(struct inet6_dev *idev) | |||
1030 | 1030 | ||
1031 | static void mld_dad_start_timer(struct inet6_dev *idev, unsigned long delay) | 1031 | static void mld_dad_start_timer(struct inet6_dev *idev, unsigned long delay) |
1032 | { | 1032 | { |
1033 | unsigned long tv = net_random() % delay; | 1033 | unsigned long tv = prandom_u32() % delay; |
1034 | 1034 | ||
1035 | if (!mod_timer(&idev->mc_dad_timer, jiffies+tv+2)) | 1035 | if (!mod_timer(&idev->mc_dad_timer, jiffies+tv+2)) |
1036 | in6_dev_hold(idev); | 1036 | in6_dev_hold(idev); |
@@ -1061,7 +1061,7 @@ static void igmp6_group_queried(struct ifmcaddr6 *ma, unsigned long resptime) | |||
1061 | } | 1061 | } |
1062 | 1062 | ||
1063 | if (delay >= resptime) | 1063 | if (delay >= resptime) |
1064 | delay = net_random() % resptime; | 1064 | delay = prandom_u32() % resptime; |
1065 | 1065 | ||
1066 | ma->mca_timer.expires = jiffies + delay; | 1066 | ma->mca_timer.expires = jiffies + delay; |
1067 | if (!mod_timer(&ma->mca_timer, jiffies + delay)) | 1067 | if (!mod_timer(&ma->mca_timer, jiffies + delay)) |
@@ -2328,7 +2328,7 @@ static void igmp6_join_group(struct ifmcaddr6 *ma) | |||
2328 | 2328 | ||
2329 | igmp6_send(&ma->mca_addr, ma->idev->dev, ICMPV6_MGM_REPORT); | 2329 | igmp6_send(&ma->mca_addr, ma->idev->dev, ICMPV6_MGM_REPORT); |
2330 | 2330 | ||
2331 | delay = net_random() % unsolicited_report_interval(ma->idev); | 2331 | delay = prandom_u32() % unsolicited_report_interval(ma->idev); |
2332 | 2332 | ||
2333 | spin_lock_bh(&ma->mca_lock); | 2333 | spin_lock_bh(&ma->mca_lock); |
2334 | if (del_timer(&ma->mca_timer)) { | 2334 | if (del_timer(&ma->mca_timer)) { |