get_file_rcu(): no need to check for NULL separately
authorAl Viro <viro@zeniv.linux.org.uk>
Sat, 20 Jan 2024 11:20:36 +0000 (06:20 -0500)
committerAl Viro <viro@zeniv.linux.org.uk>
Mon, 15 Apr 2024 20:03:24 +0000 (16:03 -0400)
IS_ERR(NULL) is false and IS_ERR() already comes with unlikely()...

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

index ab38b005633cf8e817b737c1948d93622e05480c..8076aef9c21011f6d52ff2366354d921c47cb2fc 100644 (file)
--- a/fs/file.c
+++ b/fs/file.c
@@ -920,13 +920,8 @@ struct file *get_file_rcu(struct file __rcu **f)
                struct file __rcu *file;
 
                file = __get_file_rcu(f);
-               if (unlikely(!file))
-                       return NULL;
-
-               if (unlikely(IS_ERR(file)))
-                       continue;
-
-               return file;
+               if (!IS_ERR(file))
+                       return file;
        }
 }
 EXPORT_SYMBOL_GPL(get_file_rcu);