summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNickolay V. Shmyrev <devnull@localhost>2005-10-20 20:11:39 +0000
committerNickolay V. Shmyrev <devnull@localhost>2005-10-20 20:11:39 +0000
commit23882c6e44a5ea6658f5b52520f4b537914aad23 (patch)
tree1118dbacd2bf2cf6763e0b3267ce2e0783a32b0c
parent4e8c37e2c7d33a82afae943dc1d8d83a3374ab8d (diff)
downloadmediapointer-dvb-s2-23882c6e44a5ea6658f5b52520f4b537914aad23.tar.gz
mediapointer-dvb-s2-23882c6e44a5ea6658f5b52520f4b537914aad23.tar.bz2
* ../v4l/compat.h:
- Fix kcalloc error with kernel < 2.6.9. Signed-off-by: Nickolay V. Shmyrev <<nshmyrev@yandex.ru>>
-rw-r--r--v4l/ChangeLog8
-rw-r--r--v4l/compat.h13
2 files changed, 20 insertions, 1 deletions
diff --git a/v4l/ChangeLog b/v4l/ChangeLog
index e121fa912..4bcdc1039 100644
--- a/v4l/ChangeLog
+++ b/v4l/ChangeLog
@@ -1,3 +1,11 @@
+2005-10-20 20:11 nshmyrev
+
+ * ../v4l/compat.h:
+
+ - Fix kcalloc error with kernel < 2.6.9.
+
+ Signed-off-by: Nickolay V. Shmyrev <<nshmyrev@yandex.ru>>
+
2005-10-20 20:00 mchehab
* ../v4l/scripts/gentree.pl:
diff --git a/v4l/compat.h b/v4l/compat.h
index 46f3ec822..be421393c 100644
--- a/v4l/compat.h
+++ b/v4l/compat.h
@@ -1,5 +1,5 @@
/*
- * $Id: compat.h,v 1.26 2005/10/20 19:27:46 nsh Exp $
+ * $Id: compat.h,v 1.27 2005/10/20 20:11:39 nsh Exp $
*/
#ifndef _COMPAT_H
@@ -217,6 +217,17 @@ static inline unsigned long vmalloc_to_pfn(void * vmalloc_addr)
#endif
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,9)
+#define kcalloc(n,size,flags) \
+({ \
+ void * __ret = NULL; \
+ __ret = kmalloc(n * size, flags); \
+ if (__ret) \
+ memset(__ret, 0, n * size); \
+ __ret; \
+})
+#endif
+
#endif
/*
* Local variables: