Merge tag 'dm-pull-5dec18' of git://git.denx.de/u-boot-dm
[platform/kernel/u-boot.git] / include / linux / err.h
index e4d22d5..22e5756 100644 (file)
@@ -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.