diff options
| author | Tony Lindgren <[email protected]> | 2018-11-08 09:57:42 -0800 |
|---|---|---|
| committer | Tony Lindgren <[email protected]> | 2018-11-08 09:57:42 -0800 |
| commit | 07fa3fa2572f2dee85beb8137f90ccf33d7206af (patch) | |
| tree | 0cec1fca7425cd6c423c53c4581ea2a9776ed411 /tools/include/linux/err.h | |
| parent | 4ed0dfe3cf39a97cd0ed532212b5e55e9752fe3f (diff) | |
| parent | 651022382c7f8da46cb4872a545ee1da6d097d2a (diff) | |
Merge tag 'v4.20-rc1' into omap-for-v4.21/dt-ti-sysc
Linux 4.20-rc1
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) return unlikely(!ptr) || IS_ERR_VALUE((unsigned long)ptr); } +static inline int __must_check PTR_ERR_OR_ZERO(__force const void *ptr) +{ + if (IS_ERR(ptr)) + return PTR_ERR(ptr); + else + return 0; +} #endif /* _LINUX_ERR_H */ |