Re: [PATCH v1] i2c: designware: Change from u32 to unsigned int for regmap_read() calls

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

 



On Tue, Jan 24, 2023 at 02:54:52PM +0200, Jarkko Nikula wrote:
> On 1/24/23 13:47, Shyam Sundar S K wrote:
> > regmap_read() API signature expects the caller to send "unsigned int"
> > type to return back the read value, but there are some occurrences of 'u32'
> > across i2c-designware-* files.
> > 
> > Change them to match the regmap_read() signature.

...

> Hmm.. I'm not sure about these. We know registers are 32-bit and change to
> unsigned int is a step being more ambiguous. I'm wearing my old embedded
> developer hat who likes to see explicit types when dealing with HW.
> 
> Andy: what was your rationale to propose changing u32 to unsigned int in
> another i2c-designware patch? Has gcc started complaining if regmap_read()
> is used with u32 type?

To be the same type as regmap API is expecting.

What you are talking about makes sense for the direct IO accessor calls.
Actually something like this had to be done when driver was converted to
regmap APIs.

Here we might have 16-bit registers, they are fine when variable is u32,
but goes over boundaries if we declare it as u16. So unsigned int makes
more sense to me.

OTOH I agree that this change is subjective since there is no functional
or other changes as long as we have unsigned int == u32.

So, up to you, guys. But I'm fine with the change.

-- 
With Best Regards,
Andy Shevchenko





[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