Commit b2e7c6e
committed
ring-buffer: Simplify ring_buffer_read_page() with guard()
The function ring_buffer_read_page() had two gotos. One was simply
returning "ret" and the other was unlocking the reader_lock.
There's no reason to use goto to simply return the "ret" variable. Instead
just return the value.
The jump to the unlocking of the reader_lock can be replaced by
guard(raw_spinlock_irqsave)(&cpu_buffer->reader_lock).
With these two changes the "ret" variable is no longer used and can be
removed. The return value on non-error is what was read and is stored in
the "read" variable.
Cc: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Link: https://lore.kernel.org/20250527145216.0187cf36@gandalf.local.home
Reviewed-by: Masami Hiramatsu (Google) <mhiramat@kernel.org>
Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>1 parent f0d8cbc commit b2e7c6e
1 file changed
+11
-17
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6531 | 6531 | | |
6532 | 6532 | | |
6533 | 6533 | | |
6534 | | - | |
6535 | 6534 | | |
6536 | 6535 | | |
6537 | 6536 | | |
6538 | | - | |
6539 | 6537 | | |
6540 | 6538 | | |
6541 | | - | |
| 6539 | + | |
6542 | 6540 | | |
6543 | 6541 | | |
6544 | 6542 | | |
6545 | 6543 | | |
6546 | 6544 | | |
6547 | 6545 | | |
6548 | | - | |
| 6546 | + | |
6549 | 6547 | | |
6550 | 6548 | | |
6551 | 6549 | | |
6552 | 6550 | | |
6553 | | - | |
| 6551 | + | |
| 6552 | + | |
6554 | 6553 | | |
6555 | | - | |
| 6554 | + | |
6556 | 6555 | | |
6557 | 6556 | | |
6558 | 6557 | | |
6559 | | - | |
| 6558 | + | |
6560 | 6559 | | |
6561 | | - | |
| 6560 | + | |
6562 | 6561 | | |
6563 | 6562 | | |
6564 | 6563 | | |
6565 | | - | |
| 6564 | + | |
6566 | 6565 | | |
6567 | 6566 | | |
6568 | 6567 | | |
| |||
6596 | 6595 | | |
6597 | 6596 | | |
6598 | 6597 | | |
6599 | | - | |
| 6598 | + | |
6600 | 6599 | | |
6601 | 6600 | | |
6602 | 6601 | | |
| |||
6605 | 6604 | | |
6606 | 6605 | | |
6607 | 6606 | | |
6608 | | - | |
| 6607 | + | |
6609 | 6608 | | |
6610 | 6609 | | |
6611 | 6610 | | |
| |||
6663 | 6662 | | |
6664 | 6663 | | |
6665 | 6664 | | |
6666 | | - | |
6667 | 6665 | | |
6668 | 6666 | | |
6669 | 6667 | | |
| |||
6690 | 6688 | | |
6691 | 6689 | | |
6692 | 6690 | | |
6693 | | - | |
6694 | | - | |
6695 | | - | |
6696 | | - | |
6697 | | - | |
| 6691 | + | |
6698 | 6692 | | |
6699 | 6693 | | |
6700 | 6694 | | |
| |||
0 commit comments