mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Sascha Hauer <s.hauer@pengutronix.de>
To: barebox@lists.infradead.org
Subject: [PATCH 01/12] crc32: activate crc32_no_comp (needed for jffs2 and UBI)
Date: Mon,  5 Jul 2010 15:16:24 +0200	[thread overview]
Message-ID: <1278335795-16289-2-git-send-email-s.hauer@pengutronix.de> (raw)
In-Reply-To: <1278335795-16289-1-git-send-email-s.hauer@pengutronix.de>

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
 include/common.h |    4 ++--
 lib/crc32.c      |   11 ++++++-----
 2 files changed, 8 insertions(+), 7 deletions(-)

diff --git a/include/common.h b/include/common.h
index 319535b..0edc778 100644
--- a/include/common.h
+++ b/include/common.h
@@ -109,8 +109,8 @@ unsigned long long	simple_strtoull(const char *cp,char **endp,unsigned int base)
 long	simple_strtol(const char *cp,char **endp,unsigned int base);
 
 /* lib_generic/crc32.c */
-ulong crc32 (ulong, const unsigned char *, uint);
-ulong crc32_no_comp (ulong, const unsigned char *, uint);
+uint32_t crc32(uint32_t, const void*, unsigned int);
+uint32_t crc32_no_comp(uint32_t, const void*, unsigned int);
 
 /* common/console.c */
 int	ctrlc (void);
diff --git a/lib/crc32.c b/lib/crc32.c
index be35366..3481782 100644
--- a/lib/crc32.c
+++ b/lib/crc32.c
@@ -132,8 +132,10 @@ static const ulong crc_table[256] = {
 #define DO8(buf)  DO4(buf); DO4(buf);
 
 /* ========================================================================= */
-ulong crc32(ulong crc, const unsigned char *buf, uint len)
+uint32_t crc32(uint32_t crc, const void *_buf, unsigned int len)
 {
+    const unsigned char *buf = _buf;
+
 #ifdef CONFIG_DYNAMIC_CRC_TABLE
     if (crc_table_empty)
       make_crc_table();
@@ -153,13 +155,13 @@ ulong crc32(ulong crc, const unsigned char *buf, uint len)
 EXPORT_SYMBOL(crc32);
 #endif
 
-#if 0
-
 /* No ones complement version. JFFS2 (and other things ?)
  * don't use ones compliment in their CRC calculations.
  */
-uLong crc32_no_comp(uLong crc, const Bytef *buf, uint len)
+uint32_t crc32_no_comp(uint32_t crc, const void *_buf, unsigned int len)
 {
+   const unsigned char *buf = _buf;
+
 #ifdef CONFIG_DYNAMIC_CRC_TABLE
     if (crc_table_empty)
       make_crc_table();
@@ -176,4 +178,3 @@ uLong crc32_no_comp(uLong crc, const Bytef *buf, uint len)
     return crc;
 }
 
-#endif
-- 
1.7.1


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

  reply	other threads:[~2010-07-05 13:16 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-07-05 13:16 UBI support Sascha Hauer
2010-07-05 13:16 ` Sascha Hauer [this message]
2010-07-05 13:16 ` [PATCH 02/12] move drivers/nand to drivers/mtd/nand Sascha Hauer
2010-07-05 13:16 ` [PATCH 03/12] add rbtree support (needed for ubi) Sascha Hauer
2010-07-05 13:16 ` [PATCH 04/12] add partition mtd support Sascha Hauer
2010-07-05 13:16 ` [PATCH 05/12] cfi_flash: Do not typedef struct flash_info Sascha Hauer
2010-07-05 13:16 ` [PATCH 06/12] cfi_flash: Do not print debug info while erasing Sascha Hauer
2010-07-05 13:16 ` [PATCH 07/12] cfi_flash: Add mtd partition support for UBI Sascha Hauer
2010-07-05 13:16 ` [PATCH 08/12] devfs: only check for ioctl function when needed Sascha Hauer
2010-07-05 13:16 ` [PATCH 09/12] include stuff missing for ubi Sascha Hauer
2010-07-05 13:16 ` [PATCH 10/12] add ubi support from u-boot. Just enough to compile and scan Sascha Hauer
2010-07-05 13:16 ` [PATCH 11/12] barebox ubi changes Sascha Hauer
2010-07-05 13:16 ` [PATCH 12/12] Add UBI commands: ubiattach, ubidetach, ubimkvol, ubirmvol Sascha Hauer
2010-07-05 15:22 ` [PATCH 02/12] move drivers/nand to drivers/mtd/nand Alessandro Rubini
2010-07-06  6:31   ` Sascha Hauer
2010-07-08  9:19 ` UBI support Baruch Siach
2010-07-16  7:27   ` Sascha Hauer
2010-07-16  8:57     ` Eric Bénard
2010-07-16 12:13     ` Esben Haabendal

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1278335795-16289-2-git-send-email-s.hauer@pengutronix.de \
    --to=s.hauer@pengutronix.de \
    --cc=barebox@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox