[PATCH] mtd: spi-nor: remove redundant continue statement

Pratyush Yadav p.yadav at ti.com
Fri Jun 18 02:49:40 PDT 2021


On 18/06/21 10:33AM, Colin King wrote:
> From: Colin Ian King <colin.king at canonical.com>
> 
> The continue statement at the end of a for-loop has no effect,
> invert the if expression and remove the continue.
> 
> Addresses-Coverity: ("Continue has no effect")

I haven't seen this tag used much before. I am not sure how useful it is.

Other than this,

Reviewed-by: Pratyush Yadav <p.yadav at ti.com>


> Signed-off-by: Colin Ian King <colin.king at canonical.com>
> ---
>  drivers/mtd/spi-nor/core.c | 4 +---
>  1 file changed, 1 insertion(+), 3 deletions(-)
> 
> diff --git a/drivers/mtd/spi-nor/core.c b/drivers/mtd/spi-nor/core.c
> index 970ed6e3f3ba..cc08bd707378 100644
> --- a/drivers/mtd/spi-nor/core.c
> +++ b/drivers/mtd/spi-nor/core.c
> @@ -1411,9 +1411,7 @@ spi_nor_find_best_erase_type(const struct spi_nor_erase_map *map,
>  			continue;
>  
>  		spi_nor_div_by_erase_size(erase, addr, &rem);
> -		if (rem)
> -			continue;
> -		else
> +		if (!rem)
>  			return erase;
>  	}
>  

-- 
Regards,
Pratyush Yadav
Texas Instruments Inc.



More information about the linux-mtd mailing list