diff options
Diffstat (limited to 'tools/include/linux/err.h')
| -rw-r--r-- | tools/include/linux/err.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/tools/include/linux/err.h b/tools/include/linux/err.h index 7a8b61ad44cb..094649667bae 100644 --- a/tools/include/linux/err.h +++ b/tools/include/linux/err.h | |||
| @@ -52,4 +52,11 @@ static inline bool __must_check IS_ERR_OR_NULL(__force const void *ptr) | |||
| 52 | return unlikely(!ptr) || IS_ERR_VALUE((unsigned long)ptr); | 52 | return unlikely(!ptr) || IS_ERR_VALUE((unsigned long)ptr); |
| 53 | } | 53 | } |
| 54 | 54 | ||
| 55 | static inline int __must_check PTR_ERR_OR_ZERO(__force const void *ptr) | ||
| 56 | { | ||
| 57 | if (IS_ERR(ptr)) | ||
| 58 | return PTR_ERR(ptr); | ||
| 59 | else | ||
| 60 | return 0; | ||
| 61 | } | ||
| 55 | #endif /* _LINUX_ERR_H */ | 62 | #endif /* _LINUX_ERR_H */ |
