[flashrom] [PATCH 2/3] Refine handling chips that exceed maximum programmer sizes.
Stefan Tauner
stefan.tauner at alumni.tuwien.ac.at
Fri Aug 15 19:40:30 CEST 2014
On Fri, 15 Aug 2014 00:46:17 +0200
Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006 at gmx.net> wrote:
> Am 08.08.2014 16:25 schrieb Stefan Tauner:
> > - Change check_max_decode() to return the number of (common) busses
> > where the flash chip exceeds the supported size of the programmer.
> > - Refine its signature to use a flashctx pointer only.
> > - Move CLI-related bits to cli_classic.c.
> > - Rename check_max_decode() to count_max_decode_exceedings() to
> > better reflect what it (now) really does.
> > - Refine the messages printed by the caller to better integrate with the new
> > setup, and simplify them.
> >
> > Signed-off-by: Stefan Tauner <stefan.tauner at alumni.tuwien.ac.at>
>
> I like it. One small comment below.
> Acked-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006 at gmx.net>
Thanks.
> > diff --git a/flashrom.c b/flashrom.c
> > index eeed90b..0ff6b63 100644
> > --- a/flashrom.c
> > +++ b/flashrom.c
> > @@ -1079,9 +1073,6 @@ int probe_flash(struct registered_master *mst, int startchip, struct flashctx *f
> > continue;
> > }
> >
> > - size = chip->total_size * 1024;
> > - check_max_decode(buses_common, size);
> > -
> > /* Start filling in the dynamic data. */
> > flash->chip = calloc(1, sizeof(struct flashchip));
> > if (!flash->chip) {
> > @@ -1091,6 +1082,7 @@ int probe_flash(struct registered_master *mst, int startchip, struct flashctx *f
> > memcpy(flash->chip, chip, sizeof(struct flashchip));
> > flash->mst = mst;
> >
> > + size = chip->total_size * 1024;
>
> At this point, it might be better to use "flash->chip->total_size *
> 1024" given that flash->chip is now valid (it wasn't valid at the old
> location).
Mh'kay :)
Committed in r1842 after constifying the argument (and adding chip->).
--
Kind regards/Mit freundlichen Grüßen, Stefan Tauner
More information about the flashrom
mailing list