aboutsummaryrefslogtreecommitdiff
path: root/tools/testing/selftests/bpf/prog_tests/btf_dedup_split.c
diff options
context:
space:
mode:
authorAlexander Lobakin <alexandr.lobakin@intel.com>2022-03-21 11:59:50 +0100
committerTony Nguyen <anthony.l.nguyen@intel.com>2022-04-07 08:20:10 -0700
commit135a161a5ea9e4f01b37defa53e7f5db43a7ca99 (patch)
tree653c4e26ddde7d135fd0455a3c1b8a0fc6d6ad7d /tools/testing/selftests/bpf/prog_tests/btf_dedup_split.c
parente8bd70250a821edb541c3abe1eacdad9f8dc7adf (diff)
ice: switch: add and use u16[] aliases to ice_adv_lkup_elem::{h, m}_u
ice_adv_lkup_elem fields h_u and m_u are being accessed as raw u16 arrays in several places. To reduce cast and braces burden, add permanent array-of-u16 aliases with the same size as the `union ice_prot_hdr` itself via anonymous unions to the actual struct declaration, and just access them directly. This: - removes the need to cast the union to u16[] and then dereference it each time -> reduces the horizon for potential bugs; - improves -Warray-bounds coverage -- the array size is now known at compilation time; - addresses cppcheck complaints. Signed-off-by: Alexander Lobakin <alexandr.lobakin@intel.com> Reviewed-by: Michal Swiatkowski <michal.swiatkowski@linux.intel.com> Tested-by: Marcin Szycik <marcin.szycik@linux.intel.com> Tested-by: Sandeep Penigalapati <sandeep.penigalapati@intel.com> Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
Diffstat (limited to 'tools/testing/selftests/bpf/prog_tests/btf_dedup_split.c')
0 files changed, 0 insertions, 0 deletions