]> www.infradead.org Git - mtd-utils.git/commitdiff
UBIFS: rename crc32 function
authorArtem Bityutskiy <Artem.Bityutskiy@nokia.com>
Wed, 22 Oct 2008 11:18:43 +0000 (14:18 +0300)
committerArtem Bityutskiy <Artem.Bityutskiy@nokia.com>
Wed, 22 Oct 2008 12:29:00 +0000 (15:29 +0300)
Zlib headers also declare crc32 symbol and it confilicts
with our crc32 fuction. So rename it.

Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
mkfs.ubifs/compr.c
mkfs.ubifs/crc32.h
mkfs.ubifs/mkfs.ubifs.c

index 285354e9f14315a7b551f33d4fc820af2ea718ec..73c7a0146c86d5a5ee3c7b73fe164519033074ee 100644 (file)
@@ -30,6 +30,7 @@
 
 #include "compr.h"
 #include "ubifs-media.h"
+#include "mkfs.ubifs.h"
 
 static void *lzo_mem;
 static unsigned long long errcnt = 0;
index 4b5117706634828fbca3ec3166d455465bca3d1b..86fc841bc967ef9b26f3354f827f6022dc6f7a43 100644 (file)
@@ -10,7 +10,7 @@
 extern const uint32_t crc32_table[256];
 
 /* Return a 32-bit CRC of the contents of the buffer. */
-static inline uint32_t crc32(uint32_t val, const void *ss, int len)
+static inline uint32_t ubifs_crc32(uint32_t val, const void *ss, int len)
 {
        const unsigned char *s = ss;
 
index e24e4283e76cc4fd2feec4e735e36f480e48f725..65ebc8cf53c42bb668936845f8376e6d40e52be0 100644 (file)
@@ -649,7 +649,7 @@ static void prepare_node(void *node, int len)
        ch->group_type = UBIFS_NO_NODE_GROUP;
        ch->sqnum = cpu_to_le64(++c->max_sqnum);
        ch->padding[0] = ch->padding[1] = 0;
-       crc = crc32(UBIFS_CRC32_INIT, node + 8, len - 8);
+       crc = ubifs_crc32(UBIFS_CRC32_INIT, node + 8, len - 8);
        ch->crc = cpu_to_le32(crc);
 }
 
@@ -713,7 +713,8 @@ static int do_pad(void *buf, int len)
                pad_len -= UBIFS_PAD_NODE_SZ;
                pad_node->pad_len = cpu_to_le32(pad_len);
 
-               crc = crc32(UBIFS_CRC32_INIT, buf + 8, UBIFS_PAD_NODE_SZ - 8);
+               crc = ubifs_crc32(UBIFS_CRC32_INIT, buf + 8,
+                                 UBIFS_PAD_NODE_SZ - 8);
                ch->crc = cpu_to_le32(crc);
 
                memset(buf + UBIFS_PAD_NODE_SZ, 0, pad_len);