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]     [Device Tree Compilter]     [Device Tree Spec]     [Linux Driver Backports]     [Video for Linux]     [Linux USB Devel]     [Linux PCI Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Yosemite Backpacking]


  Powered by Linux