Attention is currently required from: Simon Buhrow, Nico Huber, Thomas Heijligen, Paul Menzel, Edward O'Callaghan.
Aarya has posted comments on this change. ( https://review.coreboot.org/c/flashrom/+/65879 )
Change subject: flashrom.c:Add function to get a flattened view of the chip erase blocks ......................................................................
Patch Set 56:
(5 comments)
File erasure_layout.c:
https://review.coreboot.org/c/flashrom/+/65879/comment/7706a14b_e51504f3 PS54, Line 34: create_erase_layout
with the comments below I am expecting a few static functions that should be relatively small and th […]
Done
https://review.coreboot.org/c/flashrom/+/65879/comment/7cc9557c_974cf765 PS54, Line 74: block_num < block_count
No, `block_num` increases.
Done
https://review.coreboot.org/c/flashrom/+/65879/comment/c14f5e2f_a5d0c621 PS54, Line 86: (layout[layout_idx-1].layout_list[sub_block_index].start_addr >= start_addr && : layout[layout_idx-1].layout_list[sub_block_index].end_addr <= end_addr && : sub_block_index < layout[layout_idx-1].block_count)
in this new function made out of this `if`-block turn this wild predicate into a intermediate with a […]
Done
File erasure_layout.c:
https://review.coreboot.org/c/flashrom/+/65879/comment/2f65a7a0_ff25c2ec PS55, Line 58: chipoff_t addr = 0; : : for (int i = 0; addr < chip->total_size * 1024; i++) { : const struct eraseblock *block = &chip->block_erasers[eraser_idx].eraseblocks[i]; : block_count += block->count; : addr += block->size * block->count; : }
Done
https://review.coreboot.org/c/flashrom/+/65879/comment/d64aa7e0_d678b46c PS55, Line 82: layout[layout_idx].layout_list[block_num].start_addr = start_addr; : layout[layout_idx].layout_list[block_num].end_addr = end_addr; : layout[layout_idx].layout_list[block_num].selected = false; : layout[layout_idx].layout_list[block_num].block_num = block_num; : if (layout_idx > 0) { : layout[layout_idx].layout_list[block_num].first_sub_block_index = sub_block_index; : while (layout[layout_idx-1].layout_list[sub_block_index].start_addr >= start_addr && : layout[layout_idx-1].layout_list[sub_block_index].end_addr <= end_addr && : sub_block_index < layout[layout_idx-1].block_count) { : sub_block_index++; : } : layout[layout_idx].layout_list[block_num].last_sub_block_index = sub_block_index - 1; : }
Done