lkml.org 
[lkml]   [2017]   [May]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] nand_base: optimize checking of erased buffers

> This is not true for my platform, as the ecc pointer is
> chip->oob_poi + 10
>
> I suppose it's not a problem if the platform can handle
> unaligned loads, otherwise it spells trouble.
>
>
> > + unsigned long d = *((unsigned long *)bitmap);
> > + if (d == ~0UL)
> > + continue;
> > + weight = hweight_long(d);
> > bitflips += BITS_PER_LONG - weight;
> > if (unlikely(bitflips > bitflips_threshold))
> > return -EBADMSG;
> >
>
> The optimization makes sense in itself, but given that it's on an
> error path (?) I'm not sure it will bring any tangible benefits?

Well, if it is critical enough to do magic it does, it is also
important enough not to do expensive bit-counting needlessly...

--
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
[unhandled content-type:application/pgp-signature]
\
 
 \ /
  Last update: 2017-05-17 13:52    [W:0.118 / U:0.064 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site