Skip to content

Commit dfffa58

Browse files
vireshktorvalds
authored andcommitted
err.h: add (missing) unlikely() to IS_ERR_OR_NULL()
IS_ERR_VALUE() already contains it and so we need to add this only to the !ptr check. That will allow users of IS_ERR_OR_NULL(), to not add this compiler flag. Signed-off-by: Viresh Kumar <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
1 parent da48d09 commit dfffa58

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

include/linux/err.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ static inline bool __must_check IS_ERR(__force const void *ptr)
3737

3838
static inline bool __must_check IS_ERR_OR_NULL(__force const void *ptr)
3939
{
40-
return !ptr || IS_ERR_VALUE((unsigned long)ptr);
40+
return unlikely(!ptr) || IS_ERR_VALUE((unsigned long)ptr);
4141
}
4242

4343
/**

0 commit comments

Comments
 (0)