]> www.infradead.org Git - users/jedix/linux-maple.git/commit
uprobes: simplify xol_take_insn_slot() and its caller
authorOleg Nesterov <oleg@redhat.com>
Sun, 29 Sep 2024 14:42:44 +0000 (16:42 +0200)
committerPeter Zijlstra <peterz@infradead.org>
Mon, 7 Oct 2024 07:28:44 +0000 (09:28 +0200)
commit6ffe8c7d871b327d16ae6b6f1db4c8ecb0f15c64
treee56a538a57bb3b16855fcc864cfac9d7e707f973
parent430af825ba991730f8acc3c804a4aef82e9f7ff6
uprobes: simplify xol_take_insn_slot() and its caller

The do / while (slot_nr >= UINSNS_PER_PAGE) loop in xol_take_insn_slot()
makes no sense, the checked condition is always true. Change this code
to use the "for (;;)" loop, this way we do not need to change slot_nr if
test_and_set_bit() fails.

Also, kill the unnecessary xol_vaddr != NULL check in xol_get_insn_slot(),
xol_take_insn_slot() never returns NULL.

Signed-off-by: Oleg Nesterov <oleg@redhat.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Link: https://lore.kernel.org/r/20240929144244.GA9480@redhat.com
kernel/events/uprobes.c