diff options
Diffstat (limited to 'kerncompat.h')
-rw-r--r-- | kerncompat.h | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/kerncompat.h b/kerncompat.h index e374614c..19ed3fc0 100644 --- a/kerncompat.h +++ b/kerncompat.h @@ -244,11 +244,16 @@ static inline long PTR_ERR(const void *ptr) return (long) ptr; } -static inline long IS_ERR(const void *ptr) +static inline int IS_ERR(const void *ptr) { return IS_ERR_VALUE((unsigned long)ptr); } +static inline int IS_ERR_OR_NULL(const void *ptr) +{ + return !ptr || IS_ERR(ptr); +} + /* * This looks more complex than it should be. But we need to * get the type for the ~ right in round_down (it needs to be |