]> www.infradead.org Git - users/dwmw2/linux.git/commit
s390/debug: Simplify and document debug_next_entry() logic
authorNiklas Schnelle <schnelle@linux.ibm.com>
Fri, 13 Dec 2024 13:47:29 +0000 (14:47 +0100)
committerAlexander Gordeev <agordeev@linux.ibm.com>
Mon, 16 Dec 2024 15:14:26 +0000 (16:14 +0100)
commit7832b3047d10e2c1f9cfed49de818a38aea251f6
tree55f8a36cc4909aad2ae085be6cde924ffa7de5d0
parent4ec6054e7321dc24ebccaa08b3af0d590f5666e6
s390/debug: Simplify and document debug_next_entry() logic

Contrary to convention debug_next_entry() returns a falsy 0 value if
there are more entries and a truthy 1 value when there are no more
entries. As there is only one caller just reverse this logic to be less
surprising and document the behavior in a kdoc comment. Also replace the
goto with an early return. In the future this allows using it in
a do {} while (debug_next_entry(...)) loop.

Reviewed-by: Halil Pasic <pasic@linux.ibm.com>
Signed-off-by: Niklas Schnelle <schnelle@linux.ibm.com>
Signed-off-by: Alexander Gordeev <agordeev@linux.ibm.com>
arch/s390/kernel/debug.c