Re: [PATCH v3 3/3] iio: light: vcnl4000: Add interrupt support for vcnl4040

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

 




On 1/15/23 18:38, andriy.shechenko@xxxxxxxxxxxxx wrote:
Tue, Jan 10, 2023 at 02:43:23PM +0100, Mårten Lindahl kirjoitti:
Add support to configure proximity sensor interrupts and threshold
limits for vcnl4040. If an interrupt is detected an event will be
pushed to the event interface.
...

+	ret = i2c_smbus_read_word_data(data->client, VCNL4200_PS_CONF1);
+	if (ret < 0)
+		goto out;
+
+	val = (u16)ret;
Why do you need casting?

Hi Andy! I usually do this when assigning an int to a u16, since some compilers may complain about loosing precision.

In this case there is no such risk, so I guess it's fine to remove the cast. I can to that if you prefer so.

Kind regards

Mårten




[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Input]     [Linux Kernel]     [Linux SCSI]     [X.org]

  Powered by Linux