Skip to content

Commit 9560979

Browse files
bp3tk0vrostedt
authored andcommitted
ring-buffer: Wrap open-coded WARN_ONCE
Wrap open-coded WARN_ONCE functionality into the equivalent macro. Signed-off-by: Borislav Petkov <[email protected]> LKML-Reference: <[email protected]> Signed-off-by: Steven Rostedt <[email protected]>
1 parent 4dbf6bc commit 9560979

File tree

1 file changed

+5
-9
lines changed

1 file changed

+5
-9
lines changed

kernel/trace/ring_buffer.c

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2000,17 +2000,13 @@ rb_add_time_stamp(struct ring_buffer_per_cpu *cpu_buffer,
20002000
u64 *ts, u64 *delta)
20012001
{
20022002
struct ring_buffer_event *event;
2003-
static int once;
20042003
int ret;
20052004

2006-
if (unlikely(*delta > (1ULL << 59) && !once++)) {
2007-
printk(KERN_WARNING "Delta way too big! %llu"
2008-
" ts=%llu write stamp = %llu\n",
2009-
(unsigned long long)*delta,
2010-
(unsigned long long)*ts,
2011-
(unsigned long long)cpu_buffer->write_stamp);
2012-
WARN_ON(1);
2013-
}
2005+
WARN_ONCE(*delta > (1ULL << 59),
2006+
KERN_WARNING "Delta way too big! %llu ts=%llu write stamp = %llu\n",
2007+
(unsigned long long)*delta,
2008+
(unsigned long long)*ts,
2009+
(unsigned long long)cpu_buffer->write_stamp);
20142010

20152011
/*
20162012
* The delta is too big, we to add a

0 commit comments

Comments
 (0)