1 /* SPDX-License-Identifier: GPL-2.0 */
6 #define IS_ERR_VALUE(x) (unsigned long)(void *)(x) >= (unsigned long)-MAX_ERRNO
10 #define set_if_not_errno_or_zero(x, y) \
12 asm volatile ("if %0 s< -4095 goto +1\n" \
13 "if %0 s<= 0 goto +1\n" \
14 "%0 = " __STR(y) "\n" \
18 static inline int IS_ERR_OR_NULL(const void *ptr)
20 return !ptr || IS_ERR_VALUE((unsigned long)ptr);
23 static inline long PTR_ERR(const void *ptr)
28 #endif /* __ERR_H__ */