Commit-ID: 61d4595eed163ea416c13c4b994f22190711151b Gitweb: http://git.kernel.org/tip/61d4595eed163ea416c13c4b994f22190711151b Author: Levin, Alexander (Sasha Levin) <[email protected]> AuthorDate: Thu, 25 May 2017 12:58:56 +0000 Committer: Ingo Molnar <[email protected]> CommitDate: Mon, 5 Jun 2017 09:28:12 +0200
tools/include: Add IS_ERR_OR_NULL to err.h Signed-off-by: Sasha Levin <[email protected]> Cc: Linus Torvalds <[email protected]> Cc: Peter Zijlstra <[email protected]> Cc: Thomas Gleixner <[email protected]> Cc: [email protected] Cc: [email protected] Link: http://lkml.kernel.org/r/[email protected] Signed-off-by: Ingo Molnar <[email protected]> --- tools/include/linux/err.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tools/include/linux/err.h b/tools/include/linux/err.h index bdc3dd8..abf0478 100644 --- a/tools/include/linux/err.h +++ b/tools/include/linux/err.h @@ -46,4 +46,9 @@ static inline bool __must_check IS_ERR(__force const void *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 */

