err.h: add (missing) unlikely() to IS_ERR_OR_NULL()
authorViresh Kumar <viresh.kumar@linaro.org>
Sat, 16 Jan 2016 00:58:10 +0000 (16:58 -0800)
committerLinus Torvalds <torvalds@linux-foundation.org>
Sat, 16 Jan 2016 19:17:24 +0000 (11:17 -0800)
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 <viresh.kumar@linaro.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
include/linux/err.h

index a729120644d59d639ff00f4ad5f095e6b024df28..56762ab4171331f87f6ca9930a32d816b7aba581 100644 (file)
@@ -37,7 +37,7 @@ static inline bool __must_check IS_ERR(__force const void *ptr)
 
 static inline bool __must_check IS_ERR_OR_NULL(__force const void *ptr)
 {
-       return !ptr || IS_ERR_VALUE((unsigned long)ptr);
+       return unlikely(!ptr) || IS_ERR_VALUE((unsigned long)ptr);
 }
 
 /**
This page took 0.031395 seconds and 5 git commands to generate.