compat: add IS_ERR_OR_NULL()
authorHauke Mehrtens <hauke@hauke-m.de>
Wed, 28 Sep 2011 18:43:44 +0000 (20:43 +0200)
committerLuis R. Rodriguez <mcgrof@qca.qualcomm.com>
Wed, 28 Sep 2011 20:40:47 +0000 (13:40 -0700)
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
include/linux/compat-2.6.33.h

index 43f19893f4571cf37dbc89d3e9c27b05dce773a7..386ee4c9c0ad02b7062bfefe4fdd05477030db62 100644 (file)
@@ -144,6 +144,11 @@ static inline bool pci_is_pcie(struct pci_dev *dev)
 #define __always_unused                        /* unimplemented */
 #endif
 
+static inline long __must_check IS_ERR_OR_NULL(const void *ptr)
+{
+       return !ptr || IS_ERR_VALUE((unsigned long)ptr);
+}
+
 #endif /* (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,33)) */
 
 #endif /* LINUX_26_33_COMPAT_H */