[PATCH 1/3] UBI: Fastmap: Simplify expression

Brian Norris computersforpeace at gmail.com
Mon Sep 28 18:35:44 PDT 2015


On Fri, Jul 03, 2015 at 10:36:14AM +0200, Richard Weinberger wrote:
> There is no need to compute pnum again.
> 
> Signed-off-by: Richard Weinberger <richard at nod.at>

Acked-by: Brian Norris <computersforpeace at gmail.com>

> ---
>  drivers/mtd/ubi/fastmap.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/mtd/ubi/fastmap.c b/drivers/mtd/ubi/fastmap.c
> index 24f2cf6..22db594 100644
> --- a/drivers/mtd/ubi/fastmap.c
> +++ b/drivers/mtd/ubi/fastmap.c
> @@ -775,7 +775,7 @@ static int ubi_attach_fastmap(struct ubi_device *ubi,
>  		for (j = 0; j < be32_to_cpu(fm_eba->reserved_pebs); j++) {
>  			int pnum = be32_to_cpu(fm_eba->pnum[j]);
>  
> -			if ((int)be32_to_cpu(fm_eba->pnum[j]) < 0)
> +			if (pnum < 0)
>  				continue;
>  
>  			aeb = NULL;
> -- 
> 1.8.4.5
> 
> 
> ______________________________________________________
> Linux MTD discussion mailing list
> http://lists.infradead.org/mailman/listinfo/linux-mtd/



More information about the linux-mtd mailing list