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

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

 



On Sat, Dec 10, 2022 at 12:00:28AM +0200, Andy Shevchenko wrote:
> On Fri, Dec 09, 2022 at 11:05:16PM +0200, Andy Shevchenko wrote:
> > On Fri, Dec 09, 2022 at 03:50:40PM +0800, haibo.chen@xxxxxxx wrote:
> > > From: Haibo Chen <haibo.chen@xxxxxxx>

...

> > > -	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?
> 
> Looking into code more, I think we can accept this (patch 2) as a fix for now
> and clean up later on.

Looking even more, I think the better fix is to shuffle conditional, so it will
go after the bigger check.

> The problem is that it really depends on the patch 1 which we need to figure
> out what the correct fix would be.

-- 
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