bpf: Use struct_size()
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Mon, 29 Apr 2024 12:13:22 +0000 (15:13 +0300)
committerAndrii Nakryiko <andrii@kernel.org>
Mon, 29 Apr 2024 23:12:03 +0000 (16:12 -0700)
commitcb01621b6d91567ac74c8b95e4db731febdbdec3
tree824adabc8b3315962dc97d52a7dd79a93a3255e9
parent397658ddc88ce3c21d2aa3bed8e15fc69dfec946
bpf: Use struct_size()

Use struct_size() instead of hand writing it.
This is less verbose and more robust.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Acked-by: Yonghong Song <yonghong.song@linux.dev>
Link: https://lore.kernel.org/bpf/20240429121323.3818497-1-andriy.shevchenko@linux.intel.com
kernel/bpf/core.c