public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot] [PATCH 1/4] gunzip: rename z{alloc, free} to gz{alloc, free}
@ 2012-04-09 23:39 Mike Frysinger
  2012-04-09 23:39 ` [U-Boot] [PATCH 2/4] lin_gadget: use common mdelay Mike Frysinger
                   ` (3 more replies)
  0 siblings, 4 replies; 15+ messages in thread
From: Mike Frysinger @ 2012-04-09 23:39 UTC (permalink / raw)
  To: u-boot

This allows us to add a proper zalloc() func (one that does a zeroing
alloc), and removes duplicate prototypes.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
---
 fs/cramfs/uncompress.c |    7 ++-----
 include/u-boot/zlib.h  |    3 +++
 lib/gunzip.c           |   11 ++++-------
 3 files changed, 9 insertions(+), 12 deletions(-)

diff --git a/fs/cramfs/uncompress.c b/fs/cramfs/uncompress.c
index 228fe68..f431cc4 100644
--- a/fs/cramfs/uncompress.c
+++ b/fs/cramfs/uncompress.c
@@ -27,9 +27,6 @@
 
 static z_stream stream;
 
-void *zalloc(void *, unsigned, unsigned);
-void zfree(void *, void *, unsigned);
-
 /* Returns length of decompressed data. */
 int cramfs_uncompress_block (void *dst, void *src, int srclen)
 {
@@ -59,8 +56,8 @@ int cramfs_uncompress_init (void)
 {
 	int err;
 
-	stream.zalloc = zalloc;
-	stream.zfree = zfree;
+	stream.zalloc = gzalloc;
+	stream.zfree = gzfree;
 	stream.next_in = 0;
 	stream.avail_in = 0;
 
diff --git a/include/u-boot/zlib.h b/include/u-boot/zlib.h
index fb27081..fbb08a3 100644
--- a/include/u-boot/zlib.h
+++ b/include/u-boot/zlib.h
@@ -691,6 +691,9 @@ ZEXTERN int ZEXPORT inflateInit2_ OF((z_streamp strm, int  windowBits,
 	struct internal_state {int dummy;}; /* hack for buggy compilers */
 #endif
 
+extern void *gzalloc(void *, unsigned, unsigned);
+extern void gzfree(void *, void *, unsigned);
+
 #ifdef __cplusplus
 }
 #endif
diff --git a/lib/gunzip.c b/lib/gunzip.c
index 8b16b24..99a8ab0 100644
--- a/lib/gunzip.c
+++ b/lib/gunzip.c
@@ -36,10 +36,7 @@
 #define RESERVED		0xe0
 #define DEFLATED		8
 
-void *zalloc(void *, unsigned, unsigned);
-void zfree(void *, void *, unsigned);
-
-void *zalloc(void *x, unsigned items, unsigned size)
+void *gzalloc(void *x, unsigned items, unsigned size)
 {
 	void *p;
 
@@ -51,7 +48,7 @@ void *zalloc(void *x, unsigned items, unsigned size)
 	return (p);
 }
 
-void zfree(void *x, void *addr, unsigned nb)
+void gzfree(void *x, void *addr, unsigned nb)
 {
 	free (addr);
 }
@@ -94,8 +91,8 @@ int zunzip(void *dst, int dstlen, unsigned char *src, unsigned long *lenp,
 	z_stream s;
 	int r;
 
-	s.zalloc = zalloc;
-	s.zfree = zfree;
+	s.zalloc = gzalloc;
+	s.zfree = gzfree;
 
 	r = inflateInit2(&s, -MAX_WBITS);
 	if (r != Z_OK) {
-- 
1.7.8.5

^ permalink raw reply related	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2012-04-30 14:51 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-04-09 23:39 [U-Boot] [PATCH 1/4] gunzip: rename z{alloc, free} to gz{alloc, free} Mike Frysinger
2012-04-09 23:39 ` [U-Boot] [PATCH 2/4] lin_gadget: use common mdelay Mike Frysinger
2012-04-26 12:48   ` Anatolij Gustschin
2012-04-09 23:39 ` [U-Boot] [PATCH 3/4] linux/compat.h: rename from linux/mtd/compat.h Mike Frysinger
2012-04-26 13:03   ` Anatolij Gustschin
2012-04-09 23:39 ` [U-Boot] [PATCH 4/4] lin_gadget: use common linux/compat.h Mike Frysinger
2012-04-25  8:11   ` [U-Boot] [PATCH v2 " Anatolij Gustschin
2012-04-25 15:14     ` Mike Frysinger
2012-04-25 15:58     ` Lukasz Majewski
2012-04-26  9:03       ` Anatolij Gustschin
2012-04-26 10:32         ` Lukasz Majewski
2012-04-26 10:55           ` Anatolij Gustschin
2012-04-26 12:34     ` [U-Boot] [PATCH v3 " Anatolij Gustschin
2012-04-30 14:51       ` Anatolij Gustschin
2012-04-26 12:47 ` [U-Boot] [PATCH 1/4] gunzip: rename z{alloc, free} to gz{alloc, free} Anatolij Gustschin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox