All of lore.kernel.org
 help / color / mirror / Atom feed
From: Steven Rostedt <rostedt@goodmis.org>
To: linux-kernel@vger.kernel.org
Cc: Ingo Molnar <mingo@kernel.org>,
	Andrew Morton <akpm@linux-foundation.org>,
	Yaowei Bai <bywxiaobai@163.com>
Subject: [for-next][PATCH 09/13] ring_buffer: ring_buffer_empty{cpu}() can return boolean
Date: Tue, 03 Nov 2015 13:03:17 -0500	[thread overview]
Message-ID: <20151103180349.061909791@goodmis.org> (raw)
In-Reply-To: 20151103180308.542651732@goodmis.org

[-- Attachment #1: 0009-ring_buffer-ring_buffer_empty-cpu-can-return-boolean.patch --]
[-- Type: text/plain, Size: 2374 bytes --]

From: Yaowei Bai <bywxiaobai@163.com>

Make ring_buffer_empty() and ring_buffer_empty_cpu() return bool.

No functional change.

Link: http://lkml.kernel.org/r/1443537816-5788-5-git-send-email-bywxiaobai@163.com

Signed-off-by: Yaowei Bai <bywxiaobai@163.com>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
---
 include/linux/ring_buffer.h |  4 ++--
 kernel/trace/ring_buffer.c  | 10 +++++-----
 2 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/include/linux/ring_buffer.h b/include/linux/ring_buffer.h
index e2c13cd863bd..4acc552e9279 100644
--- a/include/linux/ring_buffer.h
+++ b/include/linux/ring_buffer.h
@@ -154,8 +154,8 @@ ring_buffer_swap_cpu(struct ring_buffer *buffer_a,
 }
 #endif
 
-int ring_buffer_empty(struct ring_buffer *buffer);
-int ring_buffer_empty_cpu(struct ring_buffer *buffer, int cpu);
+bool ring_buffer_empty(struct ring_buffer *buffer);
+bool ring_buffer_empty_cpu(struct ring_buffer *buffer, int cpu);
 
 void ring_buffer_record_disable(struct ring_buffer *buffer);
 void ring_buffer_record_enable(struct ring_buffer *buffer);
diff --git a/kernel/trace/ring_buffer.c b/kernel/trace/ring_buffer.c
index 26a948f3187f..fc9ce12666be 100644
--- a/kernel/trace/ring_buffer.c
+++ b/kernel/trace/ring_buffer.c
@@ -4267,7 +4267,7 @@ EXPORT_SYMBOL_GPL(ring_buffer_reset);
  * rind_buffer_empty - is the ring buffer empty?
  * @buffer: The ring buffer to test
  */
-int ring_buffer_empty(struct ring_buffer *buffer)
+bool ring_buffer_empty(struct ring_buffer *buffer)
 {
 	struct ring_buffer_per_cpu *cpu_buffer;
 	unsigned long flags;
@@ -4285,10 +4285,10 @@ int ring_buffer_empty(struct ring_buffer *buffer)
 		local_irq_restore(flags);
 
 		if (!ret)
-			return 0;
+			return false;
 	}
 
-	return 1;
+	return true;
 }
 EXPORT_SYMBOL_GPL(ring_buffer_empty);
 
@@ -4297,7 +4297,7 @@ EXPORT_SYMBOL_GPL(ring_buffer_empty);
  * @buffer: The ring buffer
  * @cpu: The CPU buffer to test
  */
-int ring_buffer_empty_cpu(struct ring_buffer *buffer, int cpu)
+bool ring_buffer_empty_cpu(struct ring_buffer *buffer, int cpu)
 {
 	struct ring_buffer_per_cpu *cpu_buffer;
 	unsigned long flags;
@@ -4305,7 +4305,7 @@ int ring_buffer_empty_cpu(struct ring_buffer *buffer, int cpu)
 	int ret;
 
 	if (!cpumask_test_cpu(cpu, buffer->cpumask))
-		return 1;
+		return true;
 
 	cpu_buffer = buffer->buffers[cpu];
 	local_irq_save(flags);
-- 
2.6.1



  parent reply	other threads:[~2015-11-03 18:04 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-03 18:03 [for-next][PATCH 00/13] tracing: Minor updates and fixes for 4.4 Steven Rostedt
2015-11-03 18:03 ` [for-next][PATCH 01/13] tracing: Call on_each_cpu() when adding or removing single pids from set_event_pid Steven Rostedt
2015-11-03 18:03 ` [for-next][PATCH 02/13] recordmcount: x86: Assign a meaningful value to rel_type_nop Steven Rostedt
2015-11-03 18:03 ` [for-next][PATCH 03/13] tracing: Only benchmark the time tracepoints take if tracing is on Steven Rostedt
2015-11-03 18:03 ` [for-next][PATCH 04/13] tracing: Update instance_rmdir() to use tracefs_remove_recursive Steven Rostedt
2015-11-03 18:03 ` [for-next][PATCH 05/13] Sample: Trace_event: Correct the comments Steven Rostedt
2015-11-03 18:03 ` [for-next][PATCH 06/13] tracing: report_latency() in trace_sched_wakeup.c can return boolean Steven Rostedt
2015-11-03 18:03 ` [for-next][PATCH 07/13] tracing: report_latency() in trace_irqsoff.c " Steven Rostedt
2015-11-03 18:03 ` [for-next][PATCH 08/13] ring-buffer: rb_is_reader_page() " Steven Rostedt
2015-11-03 18:03 ` Steven Rostedt [this message]
2015-11-03 18:03 ` [for-next][PATCH 10/13] ring-buffer: rb_per_cpu_empty() " Steven Rostedt
2015-11-03 18:03 ` [for-next][PATCH 11/13] ring-buffer: rb_event_is_commit() " Steven Rostedt
2015-11-03 18:03 ` [for-next][PATCH 12/13] tracing: is_legal_op() " Steven Rostedt
2015-11-03 18:03 ` [for-next][PATCH 13/13] tracing: ftrace_event_is_function() " Steven Rostedt

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20151103180349.061909791@goodmis.org \
    --to=rostedt@goodmis.org \
    --cc=akpm@linux-foundation.org \
    --cc=bywxiaobai@163.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.