From: Dave Airlie Date: Thu, 7 Jul 2005 10:33:26 +0000 (+1000) Subject: drm: use kcalloc now that it is available.. X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=b9523249de59c49e7c2cc83dfa73fb011a489a45;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git drm: use kcalloc now that it is available.. Make the DRM drm_calloc call kcalloc now. Signed-off-by: Dave Airlie --- diff --git a/drivers/char/drm/drmP.h b/drivers/char/drm/drmP.h index b04ddf12a0ff..2c7b1fc3bb2e 100644 --- a/drivers/char/drm/drmP.h +++ b/drivers/char/drm/drmP.h @@ -806,7 +806,6 @@ extern ssize_t drm_read(struct file *filp, char __user *buf, size_t count, extern void drm_mem_init(void); extern int drm_mem_info(char *buf, char **start, off_t offset, int request, int *eof, void *data); -extern void *drm_calloc(size_t nmemb, size_t size, int area); extern void *drm_realloc(void *oldpt, size_t oldsize, size_t size, int area); extern unsigned long drm_alloc_pages(int order, int area); @@ -1064,9 +1063,16 @@ static __inline__ void drm_free(void *pt, size_t size, int area) { kfree(pt); } + +/** Wrapper around kcalloc() */ +static __inline__ void *drm_calloc(size_t nmemb, size_t size, int area) +{ + return kcalloc(nmemb, size, GFP_KERNEL); +} #else extern void *drm_alloc(size_t size, int area); extern void drm_free(void *pt, size_t size, int area); +extern void *drm_calloc(size_t nmemb, size_t size, int area); #endif /*@}*/ diff --git a/drivers/char/drm/drm_memory.c b/drivers/char/drm/drm_memory.c index 7f53f756c052..ace3d42f4407 100644 --- a/drivers/char/drm/drm_memory.c +++ b/drivers/char/drm/drm_memory.c @@ -65,19 +65,6 @@ int drm_mem_info(char *buf, char **start, off_t offset, return 0; } -/** Wrapper around kmalloc() */ -void *drm_calloc(size_t nmemb, size_t size, int area) -{ - void *addr; - - addr = kmalloc(size * nmemb, GFP_KERNEL); - if (addr != NULL) - memset((void *)addr, 0, size * nmemb); - - return addr; -} -EXPORT_SYMBOL(drm_calloc); - /** Wrapper around kmalloc() and kfree() */ void *drm_realloc(void *oldpt, size_t oldsize, size_t size, int area) {