lkml.org 
[lkml]   [2022]   [Jul]   [14]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH] bpf: fix check against plain integer v 'NULL'
From


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>

\
 
 \ /
  Last update: 2022-07-14 22:29    [W:0.041 / U:0.952 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site