]> git.baikalelectronics.ru Git - kernel.git/commit
bpf: Use struct_size() helper
authorXiu Jianfeng <xiujianfeng@huawei.com>
Mon, 20 Dec 2021 11:30:48 +0000 (19:30 +0800)
committerAndrii Nakryiko <andrii@kernel.org>
Tue, 21 Dec 2021 23:35:48 +0000 (15:35 -0800)
commitd1e411c03549dcc3c715be08e3755c22b3400408
tree517c7fec6a7f96131428e820f97d87bbaca37f98
parent98b219825b33d5a896170a9f41f04715b527ccdf
bpf: Use struct_size() helper

In an effort to avoid open-coded arithmetic in the kernel, use the
struct_size() helper instead of open-coded calculation.

Signed-off-by: Xiu Jianfeng <xiujianfeng@huawei.com>
Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Acked-by: Yonghong Song <yhs@fb.com>
Link: https://github.com/KSPP/linux/issues/160
Link: https://lore.kernel.org/bpf/20211220113048.2859-1-xiujianfeng@huawei.com
kernel/bpf/local_storage.c
kernel/bpf/reuseport_array.c