In file_cbfs_next_file() there is a lot of complicated code to move to
the next file. Use the ALIGN() macros to simplify this.
Signed-off-by: Simon Glass <sjg@chromium.org>
while (size >= align) {
const struct cbfs_fileheader *file_header = start;
- u32 step;
int ret;
/* Check if there's a file here. */
return log_msg_ret("fill", ret);
}
- step = header.len;
- if (step % align)
- step = step + align - step % align;
-
- *used += step;
+ *used += ALIGN(header.len, align);
return 0;
}