[PATCH 02/61] btrfs: Prefer IS_ERR_OR_NULL over manual NULL check
David Sterba
dsterba at suse.cz
Fri Mar 13 19:22:15 UTC 2026
On Tue, Mar 10, 2026 at 12:48:28PM +0100, Philipp Hahn wrote:
> Prefer using IS_ERR_OR_NULL() over using IS_ERR() and a manual NULL
> check.
>
> IS_ERR_OR_NULL() already uses likely(!ptr) internally. checkpatch does
> not like nesting it:
> > WARNING: nested (un)?likely() calls, IS_ERR_OR_NULL already uses
> > unlikely() internally
> Remove the explicit use of likely().
>
> Change generated with coccinelle.
>
> To: Chris Mason <clm at fb.com>
> To: David Sterba <dsterba at suse.com>
> Cc: linux-btrfs at vger.kernel.org
> Cc: linux-kernel at vger.kernel.org
> Signed-off-by: Philipp Hahn <phahn-oss at avm.de>
Added to for-next, we seem to be using IS_ERR_OR_NULL() already in a
few other places so this is makes sense for consistency. Thanks.
More information about the Linux-security-module-archive
mailing list