Skip to content

Commit

Permalink
ring-buffer: rb_per_cpu_empty() can return boolean
Browse files Browse the repository at this point in the history
Makes rb_per_cpu_empty() return bool to improve readability.

No functional change.

Link: http://lkml.kernel.org/r/[email protected]

Signed-off-by: Yaowei Bai <[email protected]>
Signed-off-by: Steven Rostedt <[email protected]>
  • Loading branch information
baihuahua authored and rostedt committed Nov 2, 2015
1 parent 3d4e204 commit da58834
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions kernel/trace/ring_buffer.c
Original file line number Diff line number Diff line change
Expand Up @@ -3039,15 +3039,15 @@ int ring_buffer_write(struct ring_buffer *buffer,
}
EXPORT_SYMBOL_GPL(ring_buffer_write);

static int rb_per_cpu_empty(struct ring_buffer_per_cpu *cpu_buffer)
static bool rb_per_cpu_empty(struct ring_buffer_per_cpu *cpu_buffer)
{
struct buffer_page *reader = cpu_buffer->reader_page;
struct buffer_page *head = rb_set_head_page(cpu_buffer);
struct buffer_page *commit = cpu_buffer->commit_page;

/* In case of error, head will be NULL */
if (unlikely(!head))
return 1;
return true;

return reader->read == rb_page_commit(reader) &&
(commit == reader ||
Expand Down

0 comments on commit da58834

Please sign in to comment.