Attention is currently required from: Simon Buhrow, Nico Huber, Thomas Heijligen, Paul Menzel, Edward O'Callaghan.
11 comments:
File erasure_layout.c:
`unsigned int`
Done
Patch Set #54, Line 26: if (layout) {
rewrite your function like this: […]
Done
The signature of this function should be, […]
Done
\n
Done
int j = 0;
while(addr < chip->total_size * 1024) {
ok `j` is shadowed below. Rewrite this while-loop construct as a `for` loop construct as: […]
Done
)
{
trivial: `) {` and `if (!ptr)` is canonical.
Done
Patch Set #54, Line 71: chipoff_t start_addr = 0;
does this belong to the outer block_count loop? should it be reset when the inner loop finishes for […]
Yes it belongs to outer loop and resets every iteration.
Patch Set #54, Line 72: chipoff_t end_addr = 0;
delete and also don't unnecessarily initialise variables as you obscure compiler warnings.
Done
Patch Set #54, Line 74: block_num < block_count
since `block_num` is initialised to zero above doesn't this predicate become `0 < block_count` and t […]
No, `block_num` increases.
Keep minimal scope to variables so declare here, […]
Done
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;
}
looks like another function with a base case of `layout_idx == 0 => return`.
Done
To view, visit change 65879. To unsubscribe, or for help writing mail filters, visit settings.