projects
/
linux.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
3156cba
)
tools/include: Add IS_ERR_OR_NULL to err.h
author
Levin, Alexander (Sasha Levin)
<alexander.levin@verizon.com>
Thu, 25 May 2017 12:58:56 +0000
(12:58 +0000)
committer
Ingo Molnar
<mingo@kernel.org>
Mon, 5 Jun 2017 07:28:12 +0000
(09:28 +0200)
Signed-off-by: Sasha 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.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>
tools/include/linux/err.h
patch
|
blob
|
history
diff --git
a/tools/include/linux/err.h
b/tools/include/linux/err.h
index bdc3dd8131d4eb95cbff12bc9c80e59cd7312704..abf0478a8fb28f0f2621960aae345a504f28fd89 100644
(file)
--- 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 */