Re: [PATCH] lib/libcrc32c

From: Clay Haapala
Date: Tue Mar 30 2004 - 14:19:08 EST


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@xxxxxxxxx) 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@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/