linux/err.h: Add IS_ERR_OR_NULL()
authorFrançois Tigeot <ftigeot@wolfpond.org>
Wed, 6 Aug 2014 13:31:41 +0000 (15:31 +0200)
committerFrançois Tigeot <ftigeot@wolfpond.org>
Wed, 6 Aug 2014 13:36:51 +0000 (15:36 +0200)
Obtained-from: OpenBSD

sys/dev/drm/include/linux/err.h

index 858931d..420ede6 100644 (file)
@@ -51,6 +51,12 @@ IS_ERR(const void *ptr)
        return IS_ERR_VALUE((unsigned long)ptr);
 }
 
+static inline long
+IS_ERR_OR_NULL(const void *ptr)
+{
+       return !ptr || IS_ERR_VALUE((unsigned long)ptr);
+}
+
 static inline void *
 ERR_CAST(void *ptr)
 {