Simplify get_next_write in the partial write code.
Suggested by Michael Karcher.
Signed-off-by: Carl-Daniel Hailfinger c-d.hailfinger.devel.2006@gmx.net
Index: flashrom-partial_write_get_next_write_simplify/flashrom.c =================================================================== --- flashrom-partial_write_get_next_write_simplify/flashrom.c (Revision 1245) +++ flashrom-partial_write_get_next_write_simplify/flashrom.c (Arbeitskopie) @@ -928,13 +928,11 @@ /* First location where have and want * do not differ anymore. */ - first_len = i * stride - rel_start; break; } } } - /* Did the loop terminate without setting first_len? */ - if (need_write && ! first_len) + if (need_write) first_len = min(i * stride - rel_start, len); *first_start += rel_start; return first_len;
Am Sonntag, den 05.12.2010, 23:56 +0100 schrieb Carl-Daniel Hailfinger:
Simplify get_next_write in the partial write code.
Suggested by Michael Karcher.
Signed-off-by: Carl-Daniel Hailfinger c-d.hailfinger.devel.2006@gmx.net
Index: flashrom-partial_write_get_next_write_simplify/flashrom.c
--- flashrom-partial_write_get_next_write_simplify/flashrom.c (Revision 1245) +++ flashrom-partial_write_get_next_write_simplify/flashrom.c (Arbeitskopie) @@ -928,13 +928,11 @@ /* First location where have and want * do not differ anymore. */
} }first_len = i * stride - rel_start; break; }
- /* Did the loop terminate without setting first_len? */
- if (need_write && ! first_len)
- if (need_write) first_len = min(i * stride - rel_start, len); *first_start += rel_start; return first_len;
Acked-by: Michael Karcher flashrom@mkarcher.dialup.fu-berlin.de
Regards, Michael Karcher
On 06.12.2010 00:03, Michael Karcher wrote:
Am Sonntag, den 05.12.2010, 23:56 +0100 schrieb Carl-Daniel Hailfinger:
Simplify get_next_write in the partial write code.
Suggested by Michael Karcher.
Signed-off-by: Carl-Daniel Hailfinger c-d.hailfinger.devel.2006@gmx.net
Acked-by: Michael Karcher flashrom@mkarcher.dialup.fu-berlin.de
Thanks, committed in r1246.
Regards, Carl-Daniel