Commit a5a1e1c3 authored by Phil Carmody's avatar Phil Carmody Committed by james toy

There are quite a few instances in the kernel of checks of pointers both

against NULL and against the errno range, handling both cases identically.
This additional helper function would simplify such code.
Signed-off-by: default avatarPhil Carmody <ext-phil.2.carmody@nokia.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
parent 201449ca
......@@ -34,6 +34,11 @@ static inline long IS_ERR(const void *ptr)
return IS_ERR_VALUE((unsigned long)ptr);
}
static inline long IS_ERR_OR_NULL(const void *ptr)
{
return (ptr == NULL) || IS_ERR_VALUE((unsigned long)ptr);
}
/**
* ERR_CAST - Explicitly cast an error-valued pointer to another pointer type
* @ptr: The pointer to cast.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment