diff options
author | Dario Binacchi <dariobin@libero.it> | 2020-05-27 14:56:21 +0300 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2020-07-09 00:21:46 +0300 |
commit | 84dd1902443cf500b2536eeb14d6662c6b502698 (patch) | |
tree | 3c1d47d2e12dac3fcf9b089972193043ab0c206b | |
parent | 9f6a14c47ff95354185248ea6e7b1c695e64939e (diff) | |
download | u-boot-84dd1902443cf500b2536eeb14d6662c6b502698.tar.xz |
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: Dario Binacchi <dariobin@libero.it>
-rw-r--r-- | common/spl/spl_nand.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/common/spl/spl_nand.c b/common/spl/spl_nand.c index 1e6f2dce56..d13a524597 100644 --- a/common/spl/spl_nand.c +++ b/common/spl/spl_nand.c @@ -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, |