diff options
Diffstat (limited to 'include/linux/err.h')
| -rw-r--r-- | include/linux/err.h | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/include/linux/err.h b/include/linux/err.h index a4dacd745fcf..8c37be0620ab 100644 --- a/include/linux/err.h +++ b/include/linux/err.h @@ -41,9 +41,20 @@ static inline void * __must_check ERR_PTR(long error) return (void *) error; } +/** + * INIT_ERR_PTR - Init a const error pointer. + * @error: A negative error code. + * + * Like ERR_PTR(), but usable to initialize static variables. + */ +#define INIT_ERR_PTR(error) ((void *)(error)) + /* Return the pointer in the percpu address space. */ #define ERR_PTR_PCPU(error) ((void __percpu *)(unsigned long)ERR_PTR(error)) +/* Cast an error pointer to __iomem. */ +#define IOMEM_ERR_PTR(error) (__force void __iomem *)ERR_PTR(error) + /** * PTR_ERR - Extract the error code from an error pointer. * @ptr: An error pointer. |
