aboutsummaryrefslogtreecommitdiffstats
path: root/tools/include/linux/err.h
diff options
context:
space:
mode:
authorJames Morris <james.l.morris@oracle.com>2017-07-25 10:44:18 +1000
committerJames Morris <james.l.morris@oracle.com>2017-07-25 10:44:18 +1000
commit53a2ebaaabc1eb8458796fec3bc1e0e80746b642 (patch)
tree9d1f9227b49392cdd2edcc01057517da4f4b09c2 /tools/include/linux/err.h
parentLSM: Remove security_task_create() hook. (diff)
parentLinux 4.13-rc2 (diff)
sync to Linus v4.13-rc2 for subsystem developers to work against
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 */