From 737c73d1a081823f5c95a6fd68173b56a304eae5 Mon Sep 17 00:00:00 2001 From: Dave Airlie Date: Tue, 19 Dec 2006 22:10:34 +1100 Subject: add kcalloc compat for before 2.6.10 --- linux-core/drm_compat.h | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'linux-core/drm_compat.h') diff --git a/linux-core/drm_compat.h b/linux-core/drm_compat.h index 49b08865..c7a4a7e3 100644 --- a/linux-core/drm_compat.h +++ b/linux-core/drm_compat.h @@ -107,6 +107,17 @@ static inline int remap_pfn_range(struct vm_area_struct *vma, unsigned long from size, pgprot); } + +static __inline__ void *kcalloc(size_t nmemb, size_t size, int flags) +{ + void *addr; + + addr = kmalloc(size * nmemb, flags); + if (addr != NULL) + memset((void *)addr, 0, size * nmemb); + + return addr; +} #endif #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,16) -- cgit v1.2.3