diff options
author | Dave Airlie <airlied@starflyer.(none)> | 2005-07-07 06:33:26 -0400 |
---|---|---|
committer | Dave Airlie <airlied@linux.ie> | 2005-07-07 06:33:26 -0400 |
commit | b9523249de59c49e7c2cc83dfa73fb011a489a45 (patch) | |
tree | 0cebe6a2eeec658f6beb588fb7c9b6e5a5af4033 /drivers | |
parent | f650130803c4c0b5e5d76eff24faae722e3a69e2 (diff) |
drm: use kcalloc now that it is available..
Make the DRM drm_calloc call kcalloc now.
Signed-off-by: Dave Airlie <airlied@linux.ie>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/char/drm/drmP.h | 8 | ||||
-rw-r--r-- | drivers/char/drm/drm_memory.c | 13 |
2 files changed, 7 insertions, 14 deletions
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, | |||
806 | extern void drm_mem_init(void); | 806 | extern void drm_mem_init(void); |
807 | extern int drm_mem_info(char *buf, char **start, off_t offset, | 807 | extern int drm_mem_info(char *buf, char **start, off_t offset, |
808 | int request, int *eof, void *data); | 808 | int request, int *eof, void *data); |
809 | extern void *drm_calloc(size_t nmemb, size_t size, int area); | ||
810 | extern void *drm_realloc(void *oldpt, size_t oldsize, size_t size, | 809 | extern void *drm_realloc(void *oldpt, size_t oldsize, size_t size, |
811 | int area); | 810 | int area); |
812 | extern unsigned long drm_alloc_pages(int order, int area); | 811 | 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) | |||
1064 | { | 1063 | { |
1065 | kfree(pt); | 1064 | kfree(pt); |
1066 | } | 1065 | } |
1066 | |||
1067 | /** Wrapper around kcalloc() */ | ||
1068 | static __inline__ void *drm_calloc(size_t nmemb, size_t size, int area) | ||
1069 | { | ||
1070 | return kcalloc(nmemb, size, GFP_KERNEL); | ||
1071 | } | ||
1067 | #else | 1072 | #else |
1068 | extern void *drm_alloc(size_t size, int area); | 1073 | extern void *drm_alloc(size_t size, int area); |
1069 | extern void drm_free(void *pt, size_t size, int area); | 1074 | extern void drm_free(void *pt, size_t size, int area); |
1075 | extern void *drm_calloc(size_t nmemb, size_t size, int area); | ||
1070 | #endif | 1076 | #endif |
1071 | 1077 | ||
1072 | /*@}*/ | 1078 | /*@}*/ |
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, | |||
65 | return 0; | 65 | return 0; |
66 | } | 66 | } |
67 | 67 | ||
68 | /** Wrapper around kmalloc() */ | ||
69 | void *drm_calloc(size_t nmemb, size_t size, int area) | ||
70 | { | ||
71 | void *addr; | ||
72 | |||
73 | addr = kmalloc(size * nmemb, GFP_KERNEL); | ||
74 | if (addr != NULL) | ||
75 | memset((void *)addr, 0, size * nmemb); | ||
76 | |||
77 | return addr; | ||
78 | } | ||
79 | EXPORT_SYMBOL(drm_calloc); | ||
80 | |||
81 | /** Wrapper around kmalloc() and kfree() */ | 68 | /** Wrapper around kmalloc() and kfree() */ |
82 | void *drm_realloc(void *oldpt, size_t oldsize, size_t size, int area) | 69 | void *drm_realloc(void *oldpt, size_t oldsize, size_t size, int area) |
83 | { | 70 | { |