summaryrefslogtreecommitdiff
path: root/v4l/compat.h
diff options
context:
space:
mode:
Diffstat (limited to 'v4l/compat.h')
-rw-r--r--v4l/compat.h27
1 files changed, 21 insertions, 6 deletions
diff --git a/v4l/compat.h b/v4l/compat.h
index 551696082..0e2ccd7a9 100644
--- a/v4l/compat.h
+++ b/v4l/compat.h
@@ -52,14 +52,11 @@
#endif
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,19)
-# define PCIAGP_FAIL 0
-
+#define DIV_ROUND_UP(n, d) (((n) + (d) - 1) / (d))
+#define PCIAGP_FAIL 0
#define vmalloc_32_user(a) vmalloc_32(a)
-#endif
-
/* bool type and enum-based definition of true and false was added in 2.6.19 */
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,19)
typedef int bool;
#define true 1
#define false 0
@@ -231,8 +228,26 @@ typedef unsigned long uintptr_t;
#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 26)
static inline int list_is_singular(const struct list_head *head)
{
- return !list_empty(head) && (head->next == head->prev);
+ return !list_empty(head) && (head->next == head->prev);
}
+
+#endif
+
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 27)
+#define current_uid() (current->uid)
+#endif
+
+#ifndef WARN
+#define WARN(condition, format...) ({ \
+ int __ret_warn_on = !!(condition); \
+ if (unlikely(__ret_warn_on)) \
+ printk(KERN_WARNING format); \
+ unlikely(__ret_warn_on); \
+})
+#endif
+
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 28)
+#define snd_BUG_ON(cond) WARN((cond), "BUG? (%s)\n", __stringify(cond))
#endif
#endif