X-Git-Url: https://git.kernel.dk/?p=fio.git;a=blobdiff_plain;f=err.h;h=0765f1b6d8c0bca1e0e4761912e431cf06625e41;hp=5c024ee887867265c1ed68dd7a1867b15aa59834;hb=de4096e8682a064ed9125af7ac30a3fe4021167b;hpb=002fe73409d1e3d5e7dfe2885f75885bfaf506bc diff --git a/err.h b/err.h index 5c024ee8..0765f1b6 100644 --- a/err.h +++ b/err.h @@ -11,26 +11,26 @@ */ #define MAX_ERRNO 4095 -#define IS_ERR_VALUE(x) ((x) >= (unsigned long)-MAX_ERRNO) +#define IS_ERR_VALUE(x) ((x) >= (uintptr_t)-MAX_ERRNO) -static inline void *ERR_PTR(long error) +static inline void *ERR_PTR(uintptr_t error) { return (void *) error; } -static inline long PTR_ERR(const void *ptr) +static inline uintptr_t PTR_ERR(const void *ptr) { - return (long) ptr; + return (uintptr_t) ptr; } -static inline long IS_ERR(const void *ptr) +static inline uintptr_t IS_ERR(const void *ptr) { - return IS_ERR_VALUE((unsigned long)ptr); + return IS_ERR_VALUE((uintptr_t)ptr); } -static inline long IS_ERR_OR_NULL(const void *ptr) +static inline uintptr_t IS_ERR_OR_NULL(const void *ptr) { - return !ptr || IS_ERR_VALUE((unsigned long)ptr); + return !ptr || IS_ERR_VALUE((uintptr_t)ptr); } static inline int PTR_ERR_OR_ZERO(const void *ptr)