Edward O'Callaghan has uploaded this change for review. ( https://review.coreboot.org/c/flashrom/+/72692 )
Change subject: jedec.c: Drop branching non-zero programmer_delay() operands ......................................................................
jedec.c: Drop branching non-zero programmer_delay() operands
The programmer_delay() function is already tolerant upon zero delay values and will simply just return with a NOP. Therefore there is no need to branch.
Change-Id: Ic547669bb16e6ace4fe283e07345fc2d7075d63e Signed-off-by: Edward O'Callaghan quasisec@google.com --- M jedec.c 1 file changed, 25 insertions(+), 22 deletions(-)
git pull ssh://review.coreboot.org:29418/flashrom refs/changes/92/72692/1
diff --git a/jedec.c b/jedec.c index b44bfb7..d35bc8e 100644 --- a/jedec.c +++ b/jedec.c @@ -44,8 +44,7 @@ tmp1 = chip_readb(flash, dst) & 0x40;
while (i++ < 0xFFFFFFF) { - if (delay) - programmer_delay(flash, delay); + programmer_delay(flash, delay); tmp2 = chip_readb(flash, dst) & 0x40; if (tmp1 == tmp2) { break; @@ -204,31 +203,24 @@ * mode completely. Allow the chip to finish this before seeing a * reset command. */ - if (probe_timing_enter) - programmer_delay(flash, probe_timing_enter); + programmer_delay(flash, probe_timing_enter); /* Reset chip to a clean slate */ if ((chip->feature_bits & FEATURE_RESET_MASK) == FEATURE_LONG_RESET) { chip_writeb(flash, 0xAA, bios + ((shifted ? 0x2AAA : 0x5555) & mask)); - if (probe_timing_exit) - programmer_delay(flash, 10); + programmer_delay(flash, 10); chip_writeb(flash, 0x55, bios + ((shifted ? 0x5555 : 0x2AAA) & mask)); - if (probe_timing_exit) - programmer_delay(flash, 10); + programmer_delay(flash, 10); } chip_writeb(flash, 0xF0, bios + ((shifted ? 0x2AAA : 0x5555) & mask)); - if (probe_timing_exit) - programmer_delay(flash, probe_timing_exit); + programmer_delay(flash, probe_timing_exit);
/* Issue JEDEC Product ID Entry command */ chip_writeb(flash, 0xAA, bios + ((shifted ? 0x2AAA : 0x5555) & mask)); - if (probe_timing_enter) - programmer_delay(flash, 10); + programmer_delay(flash, 10); chip_writeb(flash, 0x55, bios + ((shifted ? 0x5555 : 0x2AAA) & mask)); - if (probe_timing_enter) - programmer_delay(flash, 10); + programmer_delay(flash, 10); chip_writeb(flash, JEDEC_REMS, bios + ((shifted ? 0x2AAA : 0x5555) & mask)); - if (probe_timing_enter) - programmer_delay(flash, probe_timing_enter); + programmer_delay(flash, probe_timing_enter);
/* Read product ID */ id1 = chip_readb(flash, bios + (0x00 << shifted)); @@ -251,15 +243,12 @@ /* Issue JEDEC Product ID Exit command */ if ((chip->feature_bits & FEATURE_RESET_MASK) == FEATURE_LONG_RESET) { chip_writeb(flash, 0xAA, bios + ((shifted ? 0x2AAA : 0x5555) & mask)); - if (probe_timing_exit) - programmer_delay(flash, 10); + programmer_delay(flash, 10); chip_writeb(flash, 0x55, bios + ((shifted ? 0x5555 : 0x2AAA) & mask)); - if (probe_timing_exit) - programmer_delay(flash, 10); + programmer_delay(flash, 10); } chip_writeb(flash, 0xF0, bios + ((shifted ? 0x2AAA : 0x5555) & mask)); - if (probe_timing_exit) - programmer_delay(flash, probe_timing_exit); + programmer_delay(flash, probe_timing_exit);
msg_cdbg("%s: id1 0x%02x, id2 0x%02x", __func__, largeid1, largeid2); if (!oddparity(id1))