Skip to content

Commit

Permalink
get_file_rcu(): no need to check for NULL separately
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Al Viro committed Apr 15, 2024
1 parent c4aab26 commit 613aee9
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions fs/file.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 613aee9

Please sign in to comment.