History

ring-buffer: rb_per_cpu_empty() can return boolean

Makes rb_per_cpu_empty() return bool to improve readability. No functional change. Link: http://lkml.kernel.org/r/1443537816-5788-6-git-send-email-bywxiaobai@163.com

Yaowei Bai committed 11 years ago

Commit da588341 parent 3d4e2041 file · +2 −2Browse files

Showing the changes to kernel/trace/ring_buffer.c (1 of 1 file). Show all

Unified · Split

kernel/trace/ring_buffer.c+2−2
@@ -3039,7 +3039,7 @@ int ring_buffer_write(struct ring_buffer *buffer, · 3038 unmodified lines
30393039 }
30403040 EXPORT_SYMBOL_GPL(ring_buffer_write);
30413041
3042−static int rb_per_cpu_empty(struct ring_buffer_per_cpu *cpu_buffer)
3042+static bool rb_per_cpu_empty(struct ring_buffer_per_cpu *cpu_buffer)
30433043 {
30443044 struct buffer_page *reader = cpu_buffer->reader_page;
30453045 struct buffer_page *head = rb_set_head_page(cpu_buffer);
@@ -3047,7 +3047,7 @@ static int rb_per_cpu_empty(struct ring_buffer_per_cpu *cpu_buffer) · 1 unmodified line
30473047
30483048 /* In case of error, head will be NULL */
30493049 if (unlikely(!head))
3050− return 1;
3050+ return true;
30513051
30523052 return reader->read == rb_page_commit(reader) &&
30533053 (commit == reader ||