]> www.infradead.org Git - users/jedix/linux-maple.git/commit
bpf: Bail out early in __htab_map_lookup_and_delete_elem()
authorHou Tao <houtao1@huawei.com>
Fri, 17 Jan 2025 10:18:13 +0000 (18:18 +0800)
committerAlexei Starovoitov <ast@kernel.org>
Mon, 20 Jan 2025 17:09:01 +0000 (09:09 -0800)
commit588c6ead325aecc9894c9925cf1f771b77437bee
tree57354835cb6b28b2bc111b2b7be8aa00aa2d5eb4
parent45dc92c32a476daf60eaef855014d0ea35780ba5
bpf: Bail out early in __htab_map_lookup_and_delete_elem()

Use goto statement to bail out early when the target element is not
found, instead of using a large else branch to handle the more likely
case. This change doesn't affect functionality and simply make the code
cleaner.

Signed-off-by: Hou Tao <houtao1@huawei.com>
Reviewed-by: Toke Høiland-Jørgensen <toke@kernel.org>
Link: https://lore.kernel.org/r/20250117101816.2101857-3-houtao@huaweicloud.com
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
kernel/bpf/hashtab.c