]> git.baikalelectronics.ru Git - kernel.git/commit
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)
commit14e856ece86a52f6851614235d8472fa69c10259
tree776c3ef83ae05684faf8d6c1d50355f0a96bf4a2
parent83d21789ada7c97dad0eded9e396887a2436d63b
libbpf: Clean up ringbuf size adjustment implementation

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

Fixes: b5e3920cb389 ("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