Messages in this thread | | | Date | Thu, 14 Jul 2022 13:28:25 -0700 | Subject | Re: [PATCH] bpf: fix check against plain integer v 'NULL' | From | Yonghong Song <> |
| |
On 7/14/22 3:03 AM, Ben Dooks wrote: > When checking with sparse, btf_show_type_value() is causing a > warning about checking integer vs NULL when the macro is passed > a pointer, due to the 'value != 0' check. Stop sparse complaining > about any type-casting by adding a cast to the typeof(value). > > This fixes the following sparse warnings: > > kernel/bpf/btf.c:2579:17: warning: Using plain integer as NULL pointer > kernel/bpf/btf.c:2581:17: warning: Using plain integer as NULL pointer > kernel/bpf/btf.c:3407:17: warning: Using plain integer as NULL pointer > kernel/bpf/btf.c:3758:9: warning: Using plain integer as NULL pointer > > Signed-off-by: Ben Dooks <ben.dooks@sifive.com>
Acked-by: Yonghong Song <yhs@fb.com>
| |