1 /* SPDX-License-Identifier: GPL-2.0 */
6 #define IS_ERR_VALUE(x) unlikely((x) >= (unsigned long)-MAX_ERRNO)
8 static inline void * __must_check
ERR_PTR(long error
)
10 return (void *) error
;
13 static inline long __must_check
PTR_ERR(const void *ptr
)
18 static inline long __must_check
IS_ERR(const void *ptr
)
20 return IS_ERR_VALUE((unsigned long)ptr
);
23 static inline long __must_check
IS_ERR_OR_NULL(const void *ptr
)
25 return !ptr
|| IS_ERR_VALUE((unsigned long)ptr
);