aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/mem_region-malloc.h1
-rw-r--r--libflash/libffs.c8
2 files changed, 1 insertions, 8 deletions
diff --git a/include/mem_region-malloc.h b/include/mem_region-malloc.h
index 58027ae..41e19de 100644
--- a/include/mem_region-malloc.h
+++ b/include/mem_region-malloc.h
@@ -31,6 +31,7 @@ void *__memalign(size_t boundary, size_t size, const char *location) __warn_unus
#define malloc(size) __malloc(size, __location__)
#define zalloc(size) __zalloc(size, __location__)
+#define calloc(nmemb, size) __zalloc(((nmemb) * (size)), __location__)
#define realloc(ptr, size) __realloc(ptr, size, __location__)
#define free(ptr) __free(ptr, __location__)
#define memalign(boundary, size) __memalign(boundary, size, __location__)
diff --git a/libflash/libffs.c b/libflash/libffs.c
index 82caeb3..09448a0 100644
--- a/libflash/libffs.c
+++ b/libflash/libffs.c
@@ -23,14 +23,6 @@
#ifndef __SKIBOOT__
#include <sys/types.h>
#include <unistd.h>
-#else
-static void *calloc(size_t num, size_t size)
-{
- void *ptr = malloc(num * size);
- if (ptr)
- memset(ptr, 0, num * size);
- return ptr;
-}
#endif
#include "ffs.h"