[U-Boot] [PATCH] sf: Read status and flag status code cleanup

Jagan Teki jteki at openedev.com
Tue Aug 18 11:27:11 CEST 2015


On 18 August 2015 at 09:05, Zhiqiang Hou <B48286 at freescale.com> wrote:
> From: Hou Zhiqiang <B48286 at freescale.com>
>
> It doesn't make sense to compare a 'u8' element with Zero.
>
> Signed-off-by: Hou Zhiqiang <B48286 at freescale.com>

Reviewed-by: Jagan Teki <jteki at openedev.com>

> ---
>  drivers/mtd/spi/sf_ops.c | 10 ++--------
>  1 file changed, 2 insertions(+), 8 deletions(-)
>
> diff --git a/drivers/mtd/spi/sf_ops.c b/drivers/mtd/spi/sf_ops.c
> index a5487ad..ba5ff0c 100644
> --- a/drivers/mtd/spi/sf_ops.c
> +++ b/drivers/mtd/spi/sf_ops.c
> @@ -162,10 +162,7 @@ static inline int spi_flash_sr_ready(struct spi_flash *flash)
>         if (ret < 0)
>                 return ret;
>
> -       if (sr < 0)
> -               return sr;
> -       else
> -               return !(sr & STATUS_WIP);
> +       return !(sr & STATUS_WIP);
>  }
>
>  static inline int spi_flash_fsr_ready(struct spi_flash *flash)
> @@ -177,10 +174,7 @@ static inline int spi_flash_fsr_ready(struct spi_flash *flash)
>         if (ret < 0)
>                 return ret;
>
> -       if (fsr < 0)
> -               return fsr;
> -       else
> -               return fsr & STATUS_PEC;
> +       return fsr & STATUS_PEC;
>  }
>
>  static int spi_flash_ready(struct spi_flash *flash)
> --
> 2.1.0.27.g96db324

thanks!
-- 
Jagan | openedev.


More information about the U-Boot mailing list