From: Hauke Mehrtens Date: Wed, 28 Sep 2011 18:43:44 +0000 (+0200) Subject: compat: add IS_ERR_OR_NULL() X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=f7d5a0caee9dc9d510278cedae4cf171835e9656;p=openwrt%2Fstaging%2Fblogic.git compat: add IS_ERR_OR_NULL() Signed-off-by: Hauke Mehrtens --- diff --git a/include/linux/compat-2.6.33.h b/include/linux/compat-2.6.33.h index 43f19893f457..386ee4c9c0ad 100644 --- a/include/linux/compat-2.6.33.h +++ b/include/linux/compat-2.6.33.h @@ -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 */