aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <maurochehab@gmail.com>2011-05-01 01:28:56 (GMT)
committerMauro Carvalho Chehab <mchehab@redhat.com>2011-05-03 12:37:53 (GMT)
commit4268c150abd21ab3e314bc2ca593ee4e1f582712 (patch)
tree0f4e03d5db88d910c98c3fd72d0365110ba049ea
parent3ddcdbaa927e0b5ab018ab61968576bad04e9b57 (diff)
Add compat bits for IS_ERR_OR_NULL()
This is defined at include/linux/err.h as: static inline long __must_check IS_ERR_OR_NULL(const void *ptr) { return !ptr || IS_ERR_VALUE((unsigned long)ptr); } To make it work, it is as simple as defining IS_ERR_OR_NULL(ptr) as: (!(ptr) || IS_ERR_VALUE((unsigned long)(ptr))) And add a new check for it: check_file_for_func("include/linux/err.h", "IS_ERR_OR_NULL", "NEED_IS_ERR_OR_NULL"); Signed-off-by: Mauro Carvalho Chehab <maurochehab@gmail.com>
-rw-r--r--v4l/compat.h4
-rwxr-xr-xv4l/scripts/make_config_compat.pl1
2 files changed, 5 insertions, 0 deletions
diff --git a/v4l/compat.h b/v4l/compat.h
index c0ad88d..02e374d 100644
--- a/v4l/compat.h
+++ b/v4l/compat.h
@@ -815,4 +815,8 @@ static inline int snd_ctl_enum_info(struct snd_ctl_elem_info *info, unsigned int
#define usleep_range(min, max) msleep(min/1000)
#endif
+#ifdef NEED_IS_ERR_OR_NULL
+#define IS_ERR_OR_NULL(ptr) (!(ptr) || IS_ERR_VALUE((unsigned long)(ptr)))
+#endif
+
#endif /* _COMPAT_H */
diff --git a/v4l/scripts/make_config_compat.pl b/v4l/scripts/make_config_compat.pl
index a426134..01f6c30 100755
--- a/v4l/scripts/make_config_compat.pl
+++ b/v4l/scripts/make_config_compat.pl
@@ -492,6 +492,7 @@ sub check_other_dependencies()
check_file_for_func("include/sound/control.h", "snd_ctl_enum_info", "NEED_SND_CTL_ENUM_INFO");
check_file_for_func("include/linux/sysfs.h", "sysfs_attr_init", "NEED_SYSFS_ATTR_INIT");
check_file_for_func("include/linux/delay.h", "usleep_range", "NEED_USLEEP_RANGE");
+ check_file_for_func("include/linux/err.h", "IS_ERR_OR_NULL", "NEED_IS_ERR_OR_NULL");
}
# Do the basic rules

Privacy Policy