diff options
Diffstat (limited to 'include/linux')
-rw-r--r-- | include/linux/compat.h | 2 | ||||
-rw-r--r-- | include/linux/err.h | 5 |
2 files changed, 6 insertions, 1 deletions
diff --git a/include/linux/compat.h b/include/linux/compat.h index c7fd649f5e..533983faff 100644 --- a/include/linux/compat.h +++ b/include/linux/compat.h @@ -15,7 +15,7 @@ struct p_current{ extern struct p_current *current; -#define ndelay(x) udelay(1) +#define ndelay(x) udelay((x) < 1000 ? 1 : (x)/1000) #define dev_dbg(dev, fmt, args...) \ debug(fmt, ##args) diff --git a/include/linux/err.h b/include/linux/err.h index e4d22d508c..22e5756edd 100644 --- a/include/linux/err.h +++ b/include/linux/err.h @@ -36,6 +36,11 @@ static inline long IS_ERR(const void *ptr) return IS_ERR_VALUE((unsigned long)ptr); } +static inline bool IS_ERR_OR_NULL(const void *ptr) +{ + return !ptr || IS_ERR_VALUE((unsigned long)ptr); +} + /** * ERR_CAST - Explicitly cast an error-valued pointer to another pointer type * @ptr: The pointer to cast. |