lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <3a0edfd7-fa22-434a-902d-a3a0df1c9d0f@quicinc.com>
Date: Fri, 3 May 2024 11:49:25 -0700
From: Jeff Johnson <quic_jjohnson@...cinc.com>
To: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>,
        <linux-mtd@...ts.infradead.org>, <linux-kernel@...r.kernel.org>
CC: Miquel Raynal <miquel.raynal@...tlin.com>,
        Richard Weinberger
	<richard@....at>,
        Vignesh Raghavendra <vigneshr@...com>
Subject: Re: [PATCH v1 1/1] mtd: cfi: Get rid of redundant 'else'

On 5/3/2024 11:42 AM, Andy Shevchenko wrote:
> In the snippets like the following
> 
> 	if (...)
> 		return / goto / break / continue ...;
> 	else
> 		...
> 
> the 'else' is redundant. Get rid of it.
> 
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>

Reviewed-by: Jeff Johnson <quic_jjohnson@...cinc.com>

> ---
>  include/linux/mtd/cfi.h | 32 ++++++++++++++++----------------
>  1 file changed, 16 insertions(+), 16 deletions(-)
> 
> diff --git a/include/linux/mtd/cfi.h b/include/linux/mtd/cfi.h
> index 947410faf9e2..35ca19ae21ae 100644
> --- a/include/linux/mtd/cfi.h
> +++ b/include/linux/mtd/cfi.h
> @@ -308,32 +308,32 @@ static inline uint8_t cfi_read_query(struct map_info *map, uint32_t addr)
>  {
>  	map_word val = map_read(map, addr);
>  
> -	if (map_bankwidth_is_1(map)) {
> +	if (map_bankwidth_is_1(map))
>  		return val.x[0];
> -	} else if (map_bankwidth_is_2(map)) {
> +	if (map_bankwidth_is_2(map))
>  		return cfi16_to_cpu(map, val.x[0]);
> -	} else {
> -		/* No point in a 64-bit byteswap since that would just be
> -		   swapping the responses from different chips, and we are
> -		   only interested in one chip (a representative sample) */
> -		return cfi32_to_cpu(map, val.x[0]);
> -	}
> +	/*
> +	 * No point in a 64-bit byteswap since that would just be
> +	 * swapping the responses from different chips, and we are
> +	 * only interested in one chip (a representative sample)
> +	 */
> +	return cfi32_to_cpu(map, val.x[0]);
>  }
>  
>  static inline uint16_t cfi_read_query16(struct map_info *map, uint32_t addr)
>  {
>  	map_word val = map_read(map, addr);
>  
> -	if (map_bankwidth_is_1(map)) {
> +	if (map_bankwidth_is_1(map))
>  		return val.x[0] & 0xff;
> -	} else if (map_bankwidth_is_2(map)) {
> +	if (map_bankwidth_is_2(map))
>  		return cfi16_to_cpu(map, val.x[0]);
> -	} else {
> -		/* No point in a 64-bit byteswap since that would just be
> -		   swapping the responses from different chips, and we are
> -		   only interested in one chip (a representative sample) */
> -		return cfi32_to_cpu(map, val.x[0]);
> -	}
> +	/*
> +	 * No point in a 64-bit byteswap since that would just be
> +	 * swapping the responses from different chips, and we are
> +	 * only interested in one chip (a representative sample)
> +	 */
> +	return cfi32_to_cpu(map, val.x[0]);
>  }
>  
>  void cfi_udelay(int us);


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ