提交 3d4e204d 编写于 作者: Y Yaowei Bai 提交者: Steven Rostedt

ring_buffer: ring_buffer_empty{cpu}() can return boolean

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.comSigned-off-by: NYaowei Bai <bywxiaobai@163.com>
Signed-off-by: NSteven Rostedt <rostedt@goodmis.org>
上级 06ca3209
...@@ -154,8 +154,8 @@ ring_buffer_swap_cpu(struct ring_buffer *buffer_a, ...@@ -154,8 +154,8 @@ ring_buffer_swap_cpu(struct ring_buffer *buffer_a,
} }
#endif #endif
int ring_buffer_empty(struct ring_buffer *buffer); bool ring_buffer_empty(struct ring_buffer *buffer);
int ring_buffer_empty_cpu(struct ring_buffer *buffer, int cpu); bool ring_buffer_empty_cpu(struct ring_buffer *buffer, int cpu);
void ring_buffer_record_disable(struct ring_buffer *buffer); void ring_buffer_record_disable(struct ring_buffer *buffer);
void ring_buffer_record_enable(struct ring_buffer *buffer); void ring_buffer_record_enable(struct ring_buffer *buffer);
......
...@@ -4267,7 +4267,7 @@ EXPORT_SYMBOL_GPL(ring_buffer_reset); ...@@ -4267,7 +4267,7 @@ EXPORT_SYMBOL_GPL(ring_buffer_reset);
* rind_buffer_empty - is the ring buffer empty? * rind_buffer_empty - is the ring buffer empty?
* @buffer: The ring buffer to test * @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; struct ring_buffer_per_cpu *cpu_buffer;
unsigned long flags; unsigned long flags;
...@@ -4285,10 +4285,10 @@ int ring_buffer_empty(struct ring_buffer *buffer) ...@@ -4285,10 +4285,10 @@ int ring_buffer_empty(struct ring_buffer *buffer)
local_irq_restore(flags); local_irq_restore(flags);
if (!ret) if (!ret)
return 0; return false;
} }
return 1; return true;
} }
EXPORT_SYMBOL_GPL(ring_buffer_empty); EXPORT_SYMBOL_GPL(ring_buffer_empty);
...@@ -4297,7 +4297,7 @@ EXPORT_SYMBOL_GPL(ring_buffer_empty); ...@@ -4297,7 +4297,7 @@ EXPORT_SYMBOL_GPL(ring_buffer_empty);
* @buffer: The ring buffer * @buffer: The ring buffer
* @cpu: The CPU buffer to test * @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; struct ring_buffer_per_cpu *cpu_buffer;
unsigned long flags; unsigned long flags;
...@@ -4305,7 +4305,7 @@ int ring_buffer_empty_cpu(struct ring_buffer *buffer, int cpu) ...@@ -4305,7 +4305,7 @@ int ring_buffer_empty_cpu(struct ring_buffer *buffer, int cpu)
int ret; int ret;
if (!cpumask_test_cpu(cpu, buffer->cpumask)) if (!cpumask_test_cpu(cpu, buffer->cpumask))
return 1; return true;
cpu_buffer = buffer->buffers[cpu]; cpu_buffer = buffer->buffers[cpu];
local_irq_save(flags); local_irq_save(flags);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册