Skip to content

Commit 613aee9

Browse files
author
Al Viro
committed
get_file_rcu(): no need to check for NULL separately
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>
1 parent c4aab26 commit 613aee9

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed

fs/file.c

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -920,13 +920,8 @@ struct file *get_file_rcu(struct file __rcu **f)
920920
struct file __rcu *file;
921921

922922
file = __get_file_rcu(f);
923-
if (unlikely(!file))
924-
return NULL;
925-
926-
if (unlikely(IS_ERR(file)))
927-
continue;
928-
929-
return file;
923+
if (!IS_ERR(file))
924+
return file;
930925
}
931926
}
932927
EXPORT_SYMBOL_GPL(get_file_rcu);

0 commit comments

Comments
 (0)