libbpf: Clean up ringbuf size adjustment implementation
authorAndrii Nakryiko <andrii@kernel.org>
Tue, 10 May 2022 18:51:59 +0000 (11:51 -0700)
committerDaniel Borkmann <daniel@iogearbox.net>
Wed, 11 May 2022 12:06:29 +0000 (14:06 +0200)
commit5eefe17c7ae41bac4d2d281669e8357a10f4d5a4
tree776c3ef83ae05684faf8d6c1d50355f0a96bf4a2
parent93dafa92e1cf922bd06fa738bc4f85fdfb63a39f
libbpf: Clean up ringbuf size adjustment implementation

Drop unused iteration variable, move overflow prevention check into the
for loop.

Fixes: 0087a681fa8c ("libbpf: Automatically fix up BPF_MAP_TYPE_RINGBUF size, if necessary")
Reported-by: Nathan Chancellor <nathan@kernel.org>
Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Link: https://lore.kernel.org/bpf/20220510185159.754299-1-andrii@kernel.org
tools/lib/bpf/libbpf.c