regularize emptiness checks in fini_module(2) and vfs_dedupe_file_range()
authorAl Viro <viro@zeniv.linux.org.uk>
Sat, 20 Jul 2024 05:17:52 +0000 (01:17 -0400)
committerAl Viro <viro@zeniv.linux.org.uk>
Sun, 3 Nov 2024 06:28:06 +0000 (01:28 -0500)
commit05e555642c4613d5a2438351c705bb2119352757
treed33b0f332362330e060b438b04711ca44ff96cfa
parent53c0a58beb60b76e105a61aae518fd780eec03d9
regularize emptiness checks in fini_module(2) and vfs_dedupe_file_range()

With few exceptions emptiness checks are done as fd_file(...) in boolean
context (usually something like if (!fd_file(f))...); those will be
taken care of later.

However, there's a couple of places where we do those checks as
'store fd_file(...) into a variable, then check if this variable is
NULL' and those are harder to spot.

Get rid of those now.

use fd_empty() instead of extracting file and then checking it for NULL.

Reviewed-by: Christian Brauner <brauner@kernel.org>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
fs/remap_range.c
kernel/module/main.c