[flashrom] [PATCH] Allow programmers to disallow writes

Carl-Daniel Hailfinger c-d.hailfinger.devel.2006 at gmx.net
Fri Jul 2 04:10:22 CEST 2010

On 01.07.2010 18:10, Michael Karcher wrote:
> Am Donnerstag, den 01.07.2010, 17:32 +0200 schrieb Carl-Daniel
> Hailfinger:
>> This feature will be used by the Nvidia MCP SPI code, and it also might
>> make sense for the gfxnvidia driver which has non-working write/erase.
> The feature looks good, but...
>> +/* Is writing allowed with this programmer? */
>> +int programmer_may_write = 1;
>> +
> ... libflashrom guys are going to hate you for another global variable,

Haha, true. But since I'm one of the developers who want libflashrom,
I'd like to deal with all globals in one big patch, not in some
piecemeal fashion. Globals are actually not such a big problem for
libflashrom because we should use a special annotation for exported
symbols of the library anyway.

> I guess. And they *will* hate you for statically initialized global
> variables, because if a GUI wants to flash twice, and the first attempt
> sets programmer_may_write to zero, the second flashing process will also
> run into the "you don't want to write" test. Can't you set this variable
> to 1 at the top of the generic programmer_init function?

Can do, but only after my explicit init patch is in.

> This patch (and a patch dynamically initializing the variable at said
> point in code) are
> Acked-by: Michael Karcher <flashrom at mkarcher.dialup.fu-berlin.de>

Thanks. I'll wait until the explicit init patch is committed before I
commit this.



More information about the flashrom mailing list