Messages in this thread Patch in this message | | | From | Joe Perches <> | Subject | [PATCH 42/49] include/linux/coda_linux.h: Use vzalloc | Date | Thu, 4 Nov 2010 20:08:06 -0700 |
| |
Signed-off-by: Joe Perches <joe@perches.com> --- include/linux/coda_linux.h | 26 ++++++++++++++++---------- 1 files changed, 16 insertions(+), 10 deletions(-)
diff --git a/include/linux/coda_linux.h b/include/linux/coda_linux.h index 2e914d0..57460f3 100644 --- a/include/linux/coda_linux.h +++ b/include/linux/coda_linux.h @@ -55,19 +55,25 @@ unsigned short coda_flags_to_cflags(unsigned short); void coda_sysctl_init(void); void coda_sysctl_clean(void); -#define CODA_ALLOC(ptr, cast, size) do { \ - if (size < PAGE_SIZE) \ - ptr = kmalloc((unsigned long) size, GFP_KERNEL); \ - else \ - ptr = (cast)vmalloc((unsigned long) size); \ - if (!ptr) \ - printk("kernel malloc returns 0 at %s:%d\n", __FILE__, __LINE__); \ - else memset( ptr, 0, size ); \ +#define CODA_ALLOC(ptr, cast, size) \ +do { \ + if (size < PAGE_SIZE) \ + ptr = kzalloc((unsigned long) size, GFP_KERNEL); \ + else \ + ptr = vzalloc((unsigned long) size); \ + if (!ptr) \ + printk(KERN_ERR "kernel malloc returns 0 at %s:%d\n", \ + __FILE__, __LINE__); \ } while (0) -#define CODA_FREE(ptr,size) \ - do { if (size < PAGE_SIZE) kfree((ptr)); else vfree((ptr)); } while (0) +#define CODA_FREE(ptr, size) \ +do { \ + if (size < PAGE_SIZE) \ + kfree((ptr)); \ + else \ + vfree((ptr)); \ +} while (0) /* inode to cnode access functions */ -- 1.7.3.1.g432b3.dirty
| |