[PATCH] mtd-utils: introduce xzalloc() helper

Mike Frysinger vapier at gentoo.org
Fri Oct 1 01:38:48 EDT 2010


Signed-off-by: Mike Frysinger <vapier at gentoo.org>
---
 include/xalloc.h |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/include/xalloc.h b/include/xalloc.h
index d49a1ae..35a94af 100644
--- a/include/xalloc.h
+++ b/include/xalloc.h
@@ -56,6 +56,12 @@ static void *xcalloc(size_t nmemb, size_t size)
 }
 
 __attribute__((unused))
+static void *xzalloc(size_t size)
+{
+	return xcalloc(1, size);
+}
+
+__attribute__((unused))
 static void *xrealloc(void *ptr, size_t size)
 {
 	ptr = realloc(ptr, size);
-- 
1.7.3.1




More information about the linux-mtd mailing list