public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Yonghong Song <yhs@fb.com>
To: Ben Dooks <ben.dooks@sifive.com>,
	linux-kernel@vger.kernel.org, bpf@vger.kernel.org
Cc: Sudip Mukherjee <sudip.mukherjee@sifive.com>,
	Jude Onyenegecha <jude.onyenegecha@sifive.com>
Subject: Re: [PATCH] bpf: fix check against plain integer v 'NULL'
Date: Thu, 14 Jul 2022 13:28:25 -0700	[thread overview]
Message-ID: <3aa0c96c-d42e-631b-5b4e-a5f67f0fc3e0@fb.com> (raw)
In-Reply-To: <20220714100322.260467-1-ben.dooks@sifive.com>



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>

  reply	other threads:[~2022-07-14 20:28 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-14 10:03 [PATCH] bpf: fix check against plain integer v 'NULL' Ben Dooks
2022-07-14 20:28 ` Yonghong Song [this message]
2022-07-15 17:00 ` patchwork-bot+netdevbpf

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3aa0c96c-d42e-631b-5b4e-a5f67f0fc3e0@fb.com \
    --to=yhs@fb.com \
    --cc=ben.dooks@sifive.com \
    --cc=bpf@vger.kernel.org \
    --cc=jude.onyenegecha@sifive.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=sudip.mukherjee@sifive.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox