[flashrom] [PATCH 1/8] whitespace, documentation and other small stuff
Stefan Tauner
stefan.tauner at student.tuwien.ac.at
Thu Mar 31 10:49:33 CEST 2011
On Thu, 31 Mar 2011 08:27:20 +0200
Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006 at gmx.net> wrote:
> Am 15.03.2011 16:29 schrieb Stefan Tauner:
> > --- a/flash.h
> > +++ b/flash.h
> > @@ -107,7 +107,9 @@ struct flashchip {
> > uint32_t manufacture_id;
> > uint32_t model_id;
> >
> > + /* Total chip size in kilobytes */
> >
>
> You can't know that, but we have a pending patch which changes this
> to bytes. OTOH, until that patch is applied, your patch makes sense.
i hope it is annotated in that patch! helps newbies when they port
their first chip ;)
> <formatting stuff>
done.
done.
and done.
> > struct block_eraser {
> > struct eraseblock{
> > unsigned int size; /* Eraseblock size */
> > --- a/spi25.c
> > +++ b/spi25.c
> > @@ -314,13 +314,14 @@ uint8_t spi_read_status_register(void)
> > /* Prettyprint the status register. Common definitions. */
> > static void spi_prettyprint_status_register_welwip(uint8_t status)
> > {
> > - msg_cdbg("Chip status register: Write Enable Latch (WEL)
> > is "
> > + msg_cdbg("Chip status register: Write Enable Latch
> > (WEL/WEN) is " "%sset\n", (status& (1<< 1)) ? "" : "not ");
> > - msg_cdbg("Chip status register: Write In Progress
> > (WIP/BUSY) is "
> > + msg_cdbg("Chip status register: Write In Progress
> > (WIP/BUSY/nRDY) is " "%sset\n", (status& (1<< 0)) ? "" : "not ");
> > }
> >
> > -/* Prettyprint the status register. Common definitions. */
> > +/* Prettyprint the status register. Common definitions.
> > + TODO: parameterize number of protected blocks. */
> >
>
> Some chips do not use _common at all, and it may be a good idea to
> create a separate function for parameter printing. Hmmm... can you
> drop this change for now?
>
> That said, I should repost my detailed locking patch which allows
> printing of locking areas as well.
when i wrote that i was not aware of your patch and what i have done
then was the least intrusive patch i could come up with: adding
another pretty print function (in patch 4/8). refactoring the whole
thing somehow sprang instantly to my mind though and that comment
remained there to remind me :)
i have reverted all spi25.c changes in 1/8 now.
> > static void spi_prettyprint_status_register_common(uint8_t status)
> > {
> > msg_cdbg("Chip status register: Bit 5 / Block Protect 3
> > (BP3) is "
>
> Rest looks OK and will be committed immediately once I have a fixed
> up version.
>
next mail.
--
Kind regards/Mit freundlichen Grüßen, Stefan Tauner
More information about the flashrom
mailing list