mirror of
https://review.coreboot.org/flashrom.git
synced 2025-08-15 19:40:19 +02:00
Simplify calls to inner write functions
No behavioural changes, just equivalence transformations. Corresponding to flashrom svn r1209. Signed-off-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net> Acked-by: Uwe Hermann <uwe@hermann-uwe.de>
This commit is contained in:
@@ -118,15 +118,9 @@ static int erase_28sf040(struct flashchip *flash)
|
||||
|
||||
int write_28sf040(struct flashchip *flash, uint8_t *buf)
|
||||
{
|
||||
int i;
|
||||
int total_size = flash->total_size * 1024;
|
||||
int page_size = flash->page_size;
|
||||
|
||||
unprotect_28sf040(flash);
|
||||
|
||||
for (i = 0; i < total_size / page_size; i++) {
|
||||
write_sector_28sf040(flash, buf + i * page_size, i * page_size, page_size);
|
||||
}
|
||||
write_sector_28sf040(flash, buf, 0, flash->total_size * 1024);
|
||||
|
||||
protect_28sf040(flash);
|
||||
|
||||
|
Reference in New Issue
Block a user