summary refs log tree commit diff
path: root/include
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2022-06-23 14:00:49 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2022-06-23 14:00:49 -0500
commitba461afbef604f58e05676ca38c2a599f073f296 (patch)
treeecaf48b678e90a4e6a8264580e28793f44ac16f4 /include
parentfa1796a835fc24eb8fb5d794512ec299dcd9f3fd (diff)
parent63b8ea5e4f1a87dea4d3114293fc8e96a8f193d7 (diff)
downloadlinux-ba461afbef604f58e05676ca38c2a599f073f296.tar.gz
Merge tag 'random-5.19-rc4-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/crng/random
Pull random number generator fixes from Jason Donenfeld:

 - A change to schedule the interrupt randomness mixing less often, yet
   credit a little more each time, to reduce overhead during interrupt
   storms.

 - Squelch an undesired pr_warn() from __ratelimit(), which was causing
   problems in the reporters' CI.

 - A trivial comment fix.

* tag 'random-5.19-rc4-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/crng/random:
  random: update comment from copy_to_user() -> copy_to_iter()
  random: quiet urandom warning ratelimit suppression message
  random: schedule mix_interrupt_randomness() less often
Diffstat (limited to 'include')
-rw-r--r--include/linux/ratelimit_types.h12
1 files changed, 8 insertions, 4 deletions
diff --git a/include/linux/ratelimit_types.h b/include/linux/ratelimit_types.h
index c21c7f8103e2..002266693e50 100644
--- a/include/linux/ratelimit_types.h
+++ b/include/linux/ratelimit_types.h
@@ -23,12 +23,16 @@ struct ratelimit_state {
 	unsigned long	flags;
 };
 
-#define RATELIMIT_STATE_INIT(name, interval_init, burst_init) {		\
-		.lock		= __RAW_SPIN_LOCK_UNLOCKED(name.lock),	\
-		.interval	= interval_init,			\
-		.burst		= burst_init,				\
+#define RATELIMIT_STATE_INIT_FLAGS(name, interval_init, burst_init, flags_init) { \
+		.lock		= __RAW_SPIN_LOCK_UNLOCKED(name.lock),		  \
+		.interval	= interval_init,				  \
+		.burst		= burst_init,					  \
+		.flags		= flags_init,					  \
 	}
 
+#define RATELIMIT_STATE_INIT(name, interval_init, burst_init) \
+	RATELIMIT_STATE_INIT_FLAGS(name, interval_init, burst_init, 0)
+
 #define RATELIMIT_STATE_INIT_DISABLED					\
 	RATELIMIT_STATE_INIT(ratelimit_state, 0, DEFAULT_RATELIMIT_BURST)