summaryrefslogtreecommitdiff
path: root/v4l/compat.h
diff options
context:
space:
mode:
Diffstat (limited to 'v4l/compat.h')
-rw-r--r--v4l/compat.h21
1 files changed, 13 insertions, 8 deletions
diff --git a/v4l/compat.h b/v4l/compat.h
index 98f57879b..1d042d96c 100644
--- a/v4l/compat.h
+++ b/v4l/compat.h
@@ -163,7 +163,8 @@ do { \
#define put_unaligned_le64(r, a) \
put_unaligned(cpu_to_le64(r), ((u64 *)(a)))
#endif
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 25)
+
+#ifdef NEED_PROC_CREATE
#ifdef CONFIG_PROC_FS
static inline struct proc_dir_entry *proc_create(const char *a,
mode_t b, struct proc_dir_entry *c, const struct file_operations *d)
@@ -215,19 +216,23 @@ static inline struct proc_dir_entry *proc_create_data(const char *a,
typedef unsigned long uintptr_t;
#endif
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 26)
-#define div64_u64(a,b) div64_64(a,b)
+#ifdef NEED_IS_SINGULAR
+static inline int list_is_singular(const struct list_head *head)
+{
+ return !list_empty(head) && (head->next == head->prev);
+}
+#endif
+#ifdef NEED_CLAMP
#define clamp( x, l, h ) max_t( __typeof__( x ), \
( l ), \
min_t( __typeof__( x ), \
( h ), \
( x ) ) )
+#endif
-static inline int list_is_singular(const struct list_head *head)
-{
- return !list_empty(head) && (head->next == head->prev);
-}
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 26)
+#define div64_u64(a,b) div64_64(a,b)
#define dev_name(dev) ((dev)->bus_id)
@@ -324,7 +329,7 @@ usb_endpoint_is_int_in(const struct usb_endpoint_descriptor *epd)
/*
* uninitialized_var() macro
*/
-#define uninitialized_var(x) x
+#define uninitialized_var(x) x = x
#endif
#endif