There's a helper function to get a ring buffer page size (the number of bytes of data recorded on the page), called rb_page_size(). Use that instead of open coding it.
Unified · Split
| @@ -3763,7 +3763,7 @@ rb_iter_peek(struct ring_buffer_iter *iter, u64 *ts) · 3762 unmodified lines | |||
| 3763 | if (rb_per_cpu_empty(cpu_buffer)) | 3763 | if (rb_per_cpu_empty(cpu_buffer)) |
| 3764 | return NULL; | 3764 | return NULL; |
| 3765 | 3765 | ||
| 3766 | if (iter->head >= local_read(&iter->head_page->page->commit)) { | 3766 | if (iter->head >= rb_page_size(iter->head_page)) { |
| 3767 | rb_inc_iter(iter); | 3767 | rb_inc_iter(iter); |
| 3768 | goto again; | 3768 | goto again; |
| 3769 | } | 3769 | } |