lkml.org 
[lkml]   [2018]   [Nov]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 3/7] mtd: spi-nor: add restriction for nmaps in smpt parser
On Thu, 8 Nov 2018 13:54:47 +0100
Boris Brezillon <boris.brezillon@bootlin.com> wrote:

> > - while (i < smpt_len) {
> > + for (nmaps = 0; i < smpt_len; nmaps++) {
> > + /*
> > + * The map selector is limited to a maximum of 8 bits, allowing
> > + * for a maximum of 256 possible map configurations. The total
> > + * number of map configurations should be addressable by the
> > + * total number of bits described by the detection commands.
> > + */
> > + if (ncmds && nmaps >= (1 << (ncmds + 1)))
> > + break;
> > +
>
> Maybe I missed something but it sounds like this change is just
> optimizing the SPMT parsing a bit, and to be honest, I'm not sure this
> is really needed. Most of the time, smpt_len will be rather small, so
> trying to bail out earlier is not bringing much perf improvements.

To make it clearer, I don't think the extra complexity is worth the tiny
perf improvement.

\
 
 \ /
  Last update: 2018-11-08 14:09    [W:0.085 / U:3.084 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site