mirror of
https://github.com/u-boot/u-boot.git
synced 2025-04-26 23:41:50 +00:00
cbfs: Simplify file iteration
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>
This commit is contained in:
parent
70a394a6b6
commit
0e2fee52d0
1 changed files with 1 additions and 6 deletions
|
@ -133,7 +133,6 @@ static int file_cbfs_next_file(struct cbfs_priv *priv, void *start, int size,
|
||||||
|
|
||||||
while (size >= align) {
|
while (size >= align) {
|
||||||
const struct cbfs_fileheader *file_header = start;
|
const struct cbfs_fileheader *file_header = start;
|
||||||
u32 step;
|
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
/* Check if there's a file here. */
|
/* Check if there's a file here. */
|
||||||
|
@ -152,11 +151,7 @@ static int file_cbfs_next_file(struct cbfs_priv *priv, void *start, int size,
|
||||||
return log_msg_ret("fill", ret);
|
return log_msg_ret("fill", ret);
|
||||||
}
|
}
|
||||||
|
|
||||||
step = header.len;
|
*used += ALIGN(header.len, align);
|
||||||
if (step % align)
|
|
||||||
step = step + align - step % align;
|
|
||||||
|
|
||||||
*used += step;
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue