Re: [PATCH v8 2/2] iio: adc: ad7173: add AD7173 driver

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

 




On 12/13/23 16:24, Andy Shevchenko wrote:
> On Tue, Dec 12, 2023 at 12:44:36PM +0200, Dumitru Ceclan wrote:
> ...
> 
>> +		if (chan->type == IIO_TEMP) {
>> +			temp = ((u32)AD7173_VOLTAGE_INT_REF_uV) * MILLI;
> 
> Hmm... Is the casting mandatory here?
> 

Yep, not really needed as MILLI is already declared as unsigned and it
will promote the _INT_REF as well. On signed32 it would have overflowed.

Are there any cases where this would not be alright?




[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