JFFS3 & performance
Joakim Tjernlund
Joakim.Tjernlund at lumentis.se
Sat Dec 18 13:13:35 EST 2004
> On Sat, 18 December 2004 18:51:08 +0100, Joakim Tjernlund wrote:
> >
> > BTW, have you tested your crc16 for correctness?
> > It doesn't give the same result as mine or Thomas versions.
>
> Nope. I completely ignored the remainding byte if len is uneven and
> didn't bother much about the usual corner-cases. Xor with ~0, off by
> one, all that. It's not performance relevant, so that can be done
> later.
Yes, I noticed that but crc16(~0, "abcd", 4) does
not yield the same result as mine.
>
> > uint32_t crc16(uint32_t crc, const void *_s, size_t len)
> > {
> > const uint16_t *s = _s;
> > uint32_t ret = crc;
> > for (; len>1; len-=2,s++) {
> > ret <<= 16;
> > ret += *s;
> > ret %= 65521;
> > }
> > return ret;
> > }
>
> Jörn
>
> --
> Mundie uses a textbook tactic of manipulation: start with some
> reasonable talk, and lead the audience to an unreasonable conclusion.
> -- Bruce Perens
More information about the linux-mtd
mailing list