[flashrom] [PATCH] dummyflasher.c: add an "empty" parameter and initialize with random bytes by default

Uwe Hermann uwe at hermann-uwe.de
Thu Jul 21 18:52:14 CEST 2011


On Thu, Jul 21, 2011 at 05:54:46PM +0200, Stefan Tauner wrote:
> previously the dummies were initialized to be empty (all ones), which makes writes skip
> erasing altogether. with this patch the default is to fill it with random bytes instead and the
> old behavior can be enforced with stating "empty=yes" on the command line.
> 
> Signed-off-by: Stefan Tauner <stefan.tauner at student.tuwien.ac.at>

I'd make the programmer options a bit more generic to allow for other
content easily and consistently:

 -p dummy:content=ff
 -p dummy:content=00
 -p dummy:content=random
 -p dummy:content=incrementing

etc.

The default should be documented in the manpage.

  
> +	empty = extract_programmer_param("empty");
> +	if (empty != NULL) {
> +		if (strstr(empty, "yes"))

Why not strcasecmp() here?


Uwe.
-- 
http://hermann-uwe.de     | http://sigrok.org
http://randomprojects.org | http://unmaintained-free-software.org




More information about the flashrom mailing list