Re: [PATCH 2/2] gpio: pca953x: avoid logically dead code

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Dec 09, 2022 at 03:50:40PM +0800, haibo.chen@xxxxxxx wrote:
> From: Haibo Chen <haibo.chen@xxxxxxx>
> 
> The current code logic make the condition "else if (reg >= 0x54)"
> can't be true, cause the dead code. So fix it to match the coder
> expectation. This is reported by Coverity.

...

> -	if (reg >= 0x30) {
> +	if (reg >= 0x30 && reg < 0x54) {
>  		/*
>  		 * Reserved block between 14h and 2Fh does not align on
>  		 * expected bank boundaries like other devices.

Can we convert this to a switch case with ranges?

-- 
With Best Regards,
Andy Shevchenko





[Index of Archives]     [Linux SPI]     [Linux Kernel]     [Linux ARM (vger)]     [Linux ARM MSM]     [Linux Omap]     [Linux Arm]     [Linux Tegra]     [Fedora ARM]     [Linux for Samsung SOC]     [eCos]     [Linux Fastboot]     [Gcc Help]     [Git]     [DCCP]     [IETF Announce]     [Security]     [Linux MIPS]     [Yosemite Campsites]

  Powered by Linux