linux/include/linux/ratelimit.h

/* SPDX-License-Identifier: GPL-2.0 */
#ifndef _LINUX_RATELIMIT_H
#define _LINUX_RATELIMIT_H

#include <linux/ratelimit_types.h>
#include <linux/sched.h>
#include <linux/spinlock.h>

static inline void ratelimit_state_init(struct ratelimit_state *rs,
					int interval, int burst)
{}

static inline void ratelimit_default_init(struct ratelimit_state *rs)
{}

static inline void ratelimit_state_exit(struct ratelimit_state *rs)
{}

static inline void
ratelimit_set_flags(struct ratelimit_state *rs, unsigned long flags)
{}

extern struct ratelimit_state printk_ratelimit_state;

#ifdef CONFIG_PRINTK

#define WARN_ON_RATELIMIT(condition, state)

#define WARN_RATELIMIT(condition, format, ...)

#else

#define WARN_ON_RATELIMIT

#define WARN_RATELIMIT

#endif

#endif /* _LINUX_RATELIMIT_H */