]> git.openfabrics.org - ~shefty/rdma-dev.git/commitdiff
ring-buffer: Wrap open-coded WARN_ONCE
authorBorislav Petkov <bp@alien8.de>
Sun, 2 May 2010 06:03:54 +0000 (08:03 +0200)
committerSteven Rostedt <rostedt@goodmis.org>
Tue, 4 May 2010 16:23:47 +0000 (12:23 -0400)
Wrap open-coded WARN_ONCE functionality into the equivalent macro.

Signed-off-by: Borislav Petkov <bp@alien8.de>
LKML-Reference: <20100502060354.GA5281@liondog.tnic>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
kernel/trace/ring_buffer.c

index 2a090448ef6b88a60fcd06c73e4c46197c4edfb1..7f6059c5aa94c772ba6ad9785c40838f96bbc77f 100644 (file)
@@ -2000,17 +2000,13 @@ rb_add_time_stamp(struct ring_buffer_per_cpu *cpu_buffer,
                  u64 *ts, u64 *delta)
 {
        struct ring_buffer_event *event;
-       static int once;
        int ret;
 
-       if (unlikely(*delta > (1ULL << 59) && !once++)) {
-               printk(KERN_WARNING "Delta way too big! %llu"
-                      " ts=%llu write stamp = %llu\n",
-                      (unsigned long long)*delta,
-                      (unsigned long long)*ts,
-                      (unsigned long long)cpu_buffer->write_stamp);
-               WARN_ON(1);
-       }
+       WARN_ONCE(*delta > (1ULL << 59),
+                 KERN_WARNING "Delta way too big! %llu ts=%llu write stamp = %llu\n",
+                 (unsigned long long)*delta,
+                 (unsigned long long)*ts,
+                 (unsigned long long)cpu_buffer->write_stamp);
 
        /*
         * The delta is too big, we to add a