Re: [PATCH bpf-next v2 1/4] libbpf: put forward declarations to btf_dump->emit_queue

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, 2024-05-28 at 15:39 -0700, Andrii Nakryiko wrote:


[...]

> I meant something less heavy-handed:
> 
> static const char *btf_dump_missing_alias(struct btf_dump *d, __u32 id)
> {
>         const char *name = btf_dump_type_name(d, id);
>         int i;
> 
>         for (i = 0; i < ARRAY_SIZE(missing_base_types); i++) {
>                 if (strcmp(name, missing_base_types[i][0]) == 0)
>                         return missing_base_types[i][1];
>         }
>         return NULL;
> }
> 
> And we actually don't need to use btf_dump_type_name(), btf_name_of()
> should be more than adequate for this.
> 
> Then if you get NULL from this function, there is no aliasing
> required. If you got non-NULL, you have the name you should alias to
> (btf_name_of() will give you original name).

This should do it, thank you.






[Index of Archives]     [Linux Samsung SoC]     [Linux Rockchip SoC]     [Linux Actions SoC]     [Linux for Synopsys ARC Processors]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]


  Powered by Linux