aboutsummaryrefslogtreecommitdiffstats
path: root/tools/include/linux/err.h
diff options
context:
space:
mode:
authorRussell King <rmk+kernel@armlinux.org.uk>2017-09-09 16:34:41 +0100
committerRussell King <rmk+kernel@armlinux.org.uk>2017-09-09 16:34:41 +0100
commite558bdc21ae1f0db520eccd84015e17d8a589973 (patch)
treeb436123bd52f267b8c7f361618cded3e1e4421ea /tools/include/linux/err.h
parentARM: 8692/1: mm: abort uaccess retries upon fatal signal (diff)
parentARM: 8691/1: Export save_stack_trace_tsk() (diff)
Merge branches 'fixes' and 'misc' into for-linus
Diffstat (limited to 'tools/include/linux/err.h')
-rw-r--r--tools/include/linux/err.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/tools/include/linux/err.h b/tools/include/linux/err.h
index bdc3dd8131d4..abf0478a8fb2 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 */