diff options
| author | Oleg Nesterov <[email protected]> | 2024-09-29 14:42:44 +0000 |
|---|---|---|
| committer | Peter Zijlstra <[email protected]> | 2024-10-07 07:28:44 +0000 |
| commit | 6ffe8c7d871b327d16ae6b6f1db4c8ecb0f15c64 (patch) | |
| tree | e56a538a57bb3b16855fcc864cfac9d7e707f973 /tools/testing/selftests/bpf/prog_tests/access_variable_array.c | |
| parent | uprobes: kill the unnecessary put_uprobe/xol_free_insn_slot in uprobe_free_ut... (diff) | |
| download | kernel-6ffe8c7d871b327d16ae6b6f1db4c8ecb0f15c64.tar.gz kernel-6ffe8c7d871b327d16ae6b6f1db4c8ecb0f15c64.zip | |
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 <[email protected]>
Signed-off-by: Peter Zijlstra (Intel) <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Diffstat (limited to 'tools/testing/selftests/bpf/prog_tests/access_variable_array.c')
0 files changed, 0 insertions, 0 deletions
