Commit 61d4595e authored by Levin, Alexander (Sasha Levin)'s avatar Levin, Alexander (Sasha Levin) Committed by Ingo Molnar

tools/include: Add IS_ERR_OR_NULL to err.h

Signed-off-by: default avatarSasha Levin <alexander.levin@verizon.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: a.p.zijlstra@chello.nl
Cc: ben@decadent.org.uk
Link: http://lkml.kernel.org/r/20170525130005.5947-20-alexander.levin@verizon.comSigned-off-by: default avatarIngo Molnar <mingo@kernel.org>
parent 3156cbae
...@@ -46,4 +46,9 @@ static inline bool __must_check IS_ERR(__force const void *ptr) ...@@ -46,4 +46,9 @@ static inline bool __must_check IS_ERR(__force const void *ptr)
return IS_ERR_VALUE((unsigned long)ptr); return IS_ERR_VALUE((unsigned long)ptr);
} }
static inline bool __must_check IS_ERR_OR_NULL(__force const void *ptr)
{
return unlikely(!ptr) || IS_ERR_VALUE((unsigned long)ptr);
}
#endif /* _LINUX_ERR_H */ #endif /* _LINUX_ERR_H */
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment