lkml.org 
[lkml]   [2004]   [Mar]   [30]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH] lib/libcrc32c
From
Date
On Tue, 30 Mar 2004, Bartlomiej Zolnierkiewicz outgrape:
> +
> +static u32 crc32c_table[256] = {
>
> Tables are build time generated in case of CRC32
> (lib/gen_crc32table.c) so you can trade some performance for smaller
> size of the table.
>
> [ However I don't know how useful is this. ]
>
As the table was statically in code in sctp and in the iSCSI driver
where it originally came from, I left it that way. Why would the
table be of a different size?

> +/*EXPORT_SYMBOL(crc32c_be);*/
> +
> +#if CRC_BE_BITS == 1 u32 attribute((pure)) crc32_be(u32 crc,
> +unsigned char const *p, size_t len) { int i; while (len--) { crc ^=
> +*p++ << 24; for (i = 0; i < 8; i++) crc = (crc << 1) ^ ((crc &
> +0x80000000) ? CRC32C_POLY_BE : 0);
> + }
> + return crc;
> +}
> +#endif
>
> Is there any reason in adding crc32_be() until it is finished
> (LE version) and/or needed?
>
> Regards,
> Bartlomiej

I judged the few lines of code needed to do the non-table version was
worth the bloat to include for completeness.
--
Clay Haapala (chaapala@cisco.com) Cisco Systems SRBU +1 763-398-1056
6450 Wedgwood Rd, Suite 130 Maple Grove MN 55311 PGP: C89240AD
Dyslexia meets Concealed Carry laws:
"Microsoft bans gnus on these premises"
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 14:02    [W:3.610 / U:0.748 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site