mirror of
https://github.com/torvalds/linux.git
synced 2026-07-27 17:47:41 +02:00
selftests/bpf: Fix up __u16 vlen assumptions
Fix up a few cases where we assume vlen is 16 bits. Signed-off-by: Alan Maguire <alan.maguire@oracle.com> Acked-by: Mykyta Yatsenko <yatsenko@meta.com> Link: https://lore.kernel.org/r/20260417143023.1551481-6-alan.maguire@oracle.com Signed-off-by: Alexei Starovoitov <ast@kernel.org>
This commit is contained in:
parent
855af3e775
commit
ad256554f1
|
|
@ -8092,7 +8092,7 @@ static struct btf_dedup_test dedup_tests[] = {
|
|||
static int btf_type_size(const struct btf_type *t)
|
||||
{
|
||||
int base_size = sizeof(struct btf_type);
|
||||
__u16 vlen = BTF_INFO_VLEN(t->info);
|
||||
__u32 vlen = BTF_INFO_VLEN(t->info);
|
||||
__u16 kind = BTF_INFO_KIND(t->info);
|
||||
|
||||
switch (kind) {
|
||||
|
|
|
|||
|
|
@ -487,9 +487,8 @@ static void test_split_module(void)
|
|||
for (i = 0; i < ARRAY_SIZE(mod_funcs); i++) {
|
||||
const struct btf_param *p;
|
||||
const struct btf_type *t;
|
||||
__u16 vlen;
|
||||
__u32 vlen, j;
|
||||
__u32 id;
|
||||
int j;
|
||||
|
||||
id = btf__find_by_name_kind(btf1, mod_funcs[i], BTF_KIND_FUNC);
|
||||
if (!ASSERT_GE(id, nr_base_types, "func_id"))
|
||||
|
|
|
|||
|
|
@ -253,8 +253,7 @@ static int find_field_offset_aux(struct btf *btf, int btf_id, char *field_name,
|
|||
{
|
||||
const struct btf_type *type = btf__type_by_id(btf, btf_id);
|
||||
const struct btf_member *m;
|
||||
__u16 mnum;
|
||||
int i;
|
||||
__u32 mnum, i;
|
||||
|
||||
if (!type) {
|
||||
PRINT_FAIL("Can't find btf_type for id %d\n", btf_id);
|
||||
|
|
|
|||
|
|
@ -1257,7 +1257,7 @@ int get_bpf_max_tramp_links_from(struct btf *btf)
|
|||
const struct btf_type *t;
|
||||
__u32 i, type_cnt;
|
||||
const char *name;
|
||||
__u16 j, vlen;
|
||||
__u32 j, vlen;
|
||||
|
||||
for (i = 1, type_cnt = btf__type_cnt(btf); i < type_cnt; i++) {
|
||||
t = btf__type_by_id(btf, i);
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user