[M] Change in flashrom[master]: flashrom.c:Add function to get a flattened view of the chip erase blocks
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 -- To view, visit https://review.coreboot.org/c/flashrom/+/65879 To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings Gerrit-Project: flashrom Gerrit-Branch: master Gerrit-Change-Id: Iafe78de00daa55f7114bd4ce09465dd88074ece4 Gerrit-Change-Number: 65879 Gerrit-PatchSet: 56 Gerrit-Owner: Aarya <aarya.chaumal@gmail.com> Gerrit-Reviewer: Edward O'Callaghan <quasisec@chromium.org> Gerrit-Reviewer: Simon Buhrow Gerrit-Reviewer: Thomas Heijligen <src@posteo.de> Gerrit-Reviewer: build bot (Jenkins) <no-reply@coreboot.org> Gerrit-CC: Anastasia Klimchuk <aklm@chromium.org> Gerrit-CC: Nico Huber <nico.h@gmx.de> Gerrit-CC: Paul Menzel <paulepanter@mailbox.org> Gerrit-Attention: Simon Buhrow Gerrit-Attention: Nico Huber <nico.h@gmx.de> Gerrit-Attention: Thomas Heijligen <src@posteo.de> Gerrit-Attention: Paul Menzel <paulepanter@mailbox.org> Gerrit-Attention: Edward O'Callaghan <quasisec@chromium.org> Gerrit-Comment-Date: Sun, 01 Jan 2023 16:22:48 +0000 Gerrit-HasComments: Yes Gerrit-Has-Labels: No Comment-In-Reply-To: Edward O'Callaghan <quasisec@chromium.org> Comment-In-Reply-To: Aarya <aarya.chaumal@gmail.com> Gerrit-MessageType: comment
participants (1)
-
Aarya (Code Review)