Skip to content

Commit

Permalink
net, lib/once: remove {net_}get_random_once_wait macro
Browse files Browse the repository at this point in the history
DO_ONCE(func, ...) will call func with spinlock which acquired by
spin_lock_irqsave in __do_once_start.  But the get_random_once_wait will
sleep in get_random_bytes_wait -> wait_for_random_bytes.

Fortunately, there is no place to use {net_}get_random_once_wait, so we
could remove them simply.

Link: https://lkml.kernel.org/r/20220619074641.40916-1-wuchi.zero@gmail.com
Signed-off-by: wuchi <wuchi.zero@gmail.com>
Acked-by: Jakub Kicinski <kuba@kernel.org>
Cc: David S. Miller <davem@davemloft.net>
Cc: Eric Dumazet <edumazet@google.com>
Cc: Paolo Abeni <pabeni@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
  • Loading branch information
wuchi authored and akpm committed Jul 18, 2022
1 parent 5a66fce commit 62df90b
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 4 deletions.
2 changes: 0 additions & 2 deletions include/linux/net.h
Original file line number Diff line number Diff line change
Expand Up @@ -303,8 +303,6 @@ do { \

#define net_get_random_once(buf, nbytes) \
get_random_once((buf), (nbytes))
#define net_get_random_once_wait(buf, nbytes) \
get_random_once_wait((buf), (nbytes))

/*
* E.g. XFS meta- & log-data is in slab pages, or bcache meta
Expand Down
2 changes: 0 additions & 2 deletions include/linux/once.h
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,5 @@ void __do_once_done(bool *done, struct static_key_true *once_key,

#define get_random_once(buf, nbytes) \
DO_ONCE(get_random_bytes, (buf), (nbytes))
#define get_random_once_wait(buf, nbytes) \
DO_ONCE(get_random_bytes_wait, (buf), (nbytes)) \

#endif /* _LINUX_ONCE_H */

0 comments on commit 62df90b

Please sign in to comment.