Re: [PATCH v1 08/12] i2c: isch: Use read_poll_timeout()

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

 



On Thu, Sep 12, 2024 at 06:35:46PM GMT, Andy Shevchenko wrote:
> Thu, Sep 12, 2024 at 09:29:38AM +0200, Andi Shyti kirjoitti:
> 
> ...
> 
> > > -		sch_io_wr8(priv, SMBHSTSTS, temp);
> > > +		sch_io_wr8(priv, SMBHSTSTS, temp & 0x0f);
> > 
> > there is still a dev_dbg() using temp. To be on the safe side, do
> > we want to do a "temp &= 0x0f" after the read_poll_timeout?
> 
> Isn't it even better that we have more information in the debug output?

I think not, because:

 1. It's information that we don't need, and we intentionally
    discard in every check. If we print a value we ignore, we
    risk providing incorrect information.

 2. It’s more future-proof. In future development, cleanups,
    refactorings, or copy-paste, temp can be used as is
    without needing to continuously & it with 0xf. This
    avoids unnecessary operations being repeated later on.

 3. It maintains the original design.

In any case, these are small details, and the patch is already
good as it is.

Thanks,
Andi




[Index of Archives]     [Linux GPIO]     [Linux SPI]     [Linux Hardward Monitoring]     [LM Sensors]     [Linux USB Devel]     [Linux Media]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux