[PATCH 42/49] include/linux/coda_linux.h: Use vzalloc

From: Joe Perches
Date: Thu Nov 04 2010 - 23:11:46 EST


Signed-off-by: Joe Perches <joe@xxxxxxxxxxx>
---
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

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/