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

Unified · Split

kernel/trace/ring_buffer.c+2−2
@@ -3039,7 +3039,7 @@ int ring_buffer_write(struct ring_buffer *buffer, · 3038 unmodified lines
3039}3039}
3040EXPORT_SYMBOL_GPL(ring_buffer_write);3040EXPORT_SYMBOL_GPL(ring_buffer_write);
3041 3041
3042static int rb_per_cpu_empty(struct ring_buffer_per_cpu *cpu_buffer)3042static bool rb_per_cpu_empty(struct ring_buffer_per_cpu *cpu_buffer)
3043{3043{
3044 struct buffer_page *reader = cpu_buffer->reader_page;3044 struct buffer_page *reader = cpu_buffer->reader_page;
3045 struct buffer_page *head = rb_set_head_page(cpu_buffer);3045 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
3047 3047
3048 /* In case of error, head will be NULL */3048 /* In case of error, head will be NULL */
3049 if (unlikely(!head))3049 if (unlikely(!head))
3050 return 1;3050 return true;
3051 3051
3052 return reader->read == rb_page_commit(reader) &&3052 return reader->read == rb_page_commit(reader) &&
3053 (commit == reader ||3053 (commit == reader ||