提交 84dd1902 编写于 作者: D Dario Binacchi 提交者: Tom Rini

spl: fit: improve spl_nand_fit_read(...) readability

Replacing the ret variable with err and handling first the error
condition about the value returned by the spl_nand_fit_read routine,
improves the code readability.
Furthermore, the 'else' int the 'else return ret' instruction was
useless.

cc: Michael Trimarchi <michael@amarulasolutions.com>
Signed-off-by: NDario Binacchi <dariobin@libero.it>
上级 9f6a14c4
......@@ -43,15 +43,15 @@ static ulong spl_nand_fit_read(struct spl_load_info *load, ulong offs,
ulong size, void *dst)
{
ulong sector;
int ret;
int err;
sector = *(int *)load->priv;
offs = sector + nand_spl_adjust_offset(sector, offs - sector);
ret = nand_spl_load_image(offs, size, dst);
if (!ret)
return size;
else
err = nand_spl_load_image(offs, size, dst);
if (err)
return 0;
return size;
}
static int spl_nand_load_element(struct spl_image_info *spl_image,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册