mirror of
https://github.com/xen-project/xen.git
synced 2026-10-29 10:40:03 +01:00
xen/console: use bool as return value from printk_ratelimit()
{__,}printk_ratelimit() are predicates. Make that pronounced by updating the
return value to boolean.
Not a functional change.
Signed-off-by: Denis Mukhin <dmukhin@ford.com>
Acked-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Teddy Astie <teddy.astie@vates.tech>
This commit is contained in:
1 parent
a7fd7d4cbd
commit
05edb693a2
2 files changed
+8
-7
No files matched your search
@@ -1282,7 +1282,8 @@ void console_end_sync(void)
|
||||
* This enforces a rate limit: not more than one kernel message
|
||||
* every printk_ratelimit_ms (millisecs).
|
||||
*/
|
||||
int __printk_ratelimit(unsigned int ratelimit_ms, unsigned int ratelimit_burst)
|
||||
bool __printk_ratelimit(unsigned int ratelimit_ms,
|
||||
unsigned int ratelimit_burst)
|
||||
{
|
||||
static DEFINE_SPINLOCK(ratelimit_lock);
|
||||
static unsigned long toks = 10 * 5 * 1000;
|
||||
@@ -1321,11 +1322,11 @@ int __printk_ratelimit(unsigned int ratelimit_ms, unsigned int ratelimit_burst)
|
||||
rspin_unlock(&console_lock);
|
||||
}
|
||||
local_irq_restore(flags);
|
||||
return 1;
|
||||
return true;
|
||||
}
|
||||
missed++;
|
||||
spin_unlock_irqrestore(&ratelimit_lock, flags);
|
||||
return 0;
|
||||
return false;
|
||||
}
|
||||
|
||||
/* Minimum time in ms between messages */
|
||||
@@ -1334,7 +1335,7 @@ static const unsigned int printk_ratelimit_ms = 5 * 1000;
|
||||
/* Number of messages we send before ratelimiting */
|
||||
static const unsigned int printk_ratelimit_burst = 10;
|
||||
|
||||
int printk_ratelimit(void)
|
||||
bool printk_ratelimit(void)
|
||||
{
|
||||
return __printk_ratelimit(printk_ratelimit_ms, printk_ratelimit_burst);
|
||||
}
|
||||
|
||||
@@ -82,9 +82,9 @@ extern void guest_printk(const struct domain *d, const char *fmt, ...)
|
||||
__attribute__ ((format (printf, 2, 3)));
|
||||
extern void noreturn panic(const char *fmt, ...)
|
||||
__attribute__ ((format (printf, 1, 2)));
|
||||
extern int __printk_ratelimit(unsigned int ratelimit_ms,
|
||||
unsigned int ratelimit_burst);
|
||||
extern int printk_ratelimit(void);
|
||||
extern bool __printk_ratelimit(unsigned int ratelimit_ms,
|
||||
unsigned int ratelimit_burst);
|
||||
extern bool printk_ratelimit(void);
|
||||
|
||||
#define gprintk(lvl, fmt, args...) \
|
||||
printk(XENLOG_GUEST lvl "%pv " fmt, current, ## args)
|
||||
|
||||