]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
btrfs: prefer IS_ERR_OR_NULL() over manual NULL check
authorPhilipp Hahn <phahn-oss@avm.de>
Tue, 10 Mar 2026 11:48:28 +0000 (12:48 +0100)
committerDavid Sterba <dsterba@suse.com>
Tue, 7 Apr 2026 16:56:02 +0000 (18:56 +0200)
commite5267796482fad93ee7948c7cbc37f32046244f7
tree49873c743e0efdff1876a00dc4414e417b39b0f5
parent94e445085c7be52c1cc937959fa8254b56cdf672
btrfs: prefer IS_ERR_OR_NULL() over manual NULL check

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.

Signed-off-by: Philipp Hahn <phahn-oss@avm.de>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/inode.c
fs/btrfs/transaction.c
fs/btrfs/tree-log.c
fs/btrfs/uuid-tree.c