Rev 3243 | Rev 4103 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 3243 | Rev 4065 | ||
---|---|---|---|
Line 22... | Line 22... | ||
22 | static inline void * __must_check ERR_PTR(long error) |
22 | static inline void * __must_check ERR_PTR(long error) |
23 | { |
23 | { |
24 | return (void *) error; |
24 | return (void *) error; |
25 | } |
25 | } |
Line 26... | Line 26... | ||
26 | 26 | ||
27 | static inline long __must_check PTR_ERR(const void *ptr) |
27 | static inline long __must_check PTR_ERR(__force const void *ptr) |
28 | { |
28 | { |
29 | return (long) ptr; |
29 | return (long) ptr; |
Line 30... | Line 30... | ||
30 | } |
30 | } |
31 | 31 | ||
32 | static inline long __must_check IS_ERR(const void *ptr) |
32 | static inline long __must_check IS_ERR(__force const void *ptr) |
33 | { |
33 | { |
Line 34... | Line 34... | ||
34 | return IS_ERR_VALUE((unsigned long)ptr); |
34 | return IS_ERR_VALUE((unsigned long)ptr); |
35 | } |
35 | } |
36 | 36 | ||
37 | static inline long __must_check IS_ERR_OR_NULL(const void *ptr) |
37 | static inline long __must_check IS_ERR_OR_NULL(__force const void *ptr) |
Line 38... | Line 38... | ||
38 | { |
38 | { |
Line 44... | Line 44... | ||
44 | * @ptr: The pointer to cast. |
44 | * @ptr: The pointer to cast. |
45 | * |
45 | * |
46 | * Explicitly cast an error-valued pointer to another pointer type in such a |
46 | * Explicitly cast an error-valued pointer to another pointer type in such a |
47 | * way as to make it clear that's what's going on. |
47 | * way as to make it clear that's what's going on. |
48 | */ |
48 | */ |
49 | static inline void * __must_check ERR_CAST(const void *ptr) |
49 | static inline void * __must_check ERR_CAST(__force const void *ptr) |
50 | { |
50 | { |
51 | /* cast away the const */ |
51 | /* cast away the const */ |
52 | return (void *) ptr; |
52 | return (void *) ptr; |
53 | } |
53 | } |
Line 54... | Line 54... | ||
54 | 54 | ||
55 | static inline int __must_check PTR_RET(const void *ptr) |
55 | static inline int __must_check PTR_RET(__force const void *ptr) |
56 | { |
56 | { |
57 | if (IS_ERR(ptr)) |
57 | if (IS_ERR(ptr)) |
58 | return PTR_ERR(ptr); |
58 | return PTR_ERR(ptr); |
59 | else |
59 | else |