Linux IIO development
 help / color / mirror / Atom feed
From: Marten Lindahl <martenli@axis.com>
To: andriy.shechenko@saunalahti.fi,
	"Mårten Lindahl" <marten.lindahl@axis.com>
Cc: Jonathan Cameron <jic23@kernel.org>,
	Lars-Peter Clausen <lars@metafoo.de>, <linux-iio@vger.kernel.org>,
	<kernel@axis.com>
Subject: Re: [PATCH v3 3/3] iio: light: vcnl4000: Add interrupt support for vcnl4040
Date: Tue, 17 Jan 2023 00:19:45 +0100	[thread overview]
Message-ID: <a5851acb-be2b-9d41-8b30-ce5094e34af5@axis.com> (raw)
In-Reply-To: <Y8Q5+9WogoIeFMmX@surfacebook>


On 1/15/23 18:38, andriy.shechenko@saunalahti.fi 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


  parent reply	other threads:[~2023-01-16 23:31 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-10 13:43 [PATCH v3 0/3] iio: light: vcnl4000: Add vcnl4040 interrupt support Mårten Lindahl
2023-01-10 13:43 ` [PATCH v3 1/3] iio: light: vcnl4000: Prepare for more generic setup Mårten Lindahl
2023-01-10 13:43 ` [PATCH v3 2/3] iio: light: vcnl4000: Make irq handling more generic Mårten Lindahl
2023-01-15 17:41   ` andriy.shechenko
2023-01-16 23:06     ` Marten Lindahl
2023-01-10 13:43 ` [PATCH v3 3/3] iio: light: vcnl4000: Add interrupt support for vcnl4040 Mårten Lindahl
2023-01-15 17:38   ` andriy.shechenko
2023-01-16 17:32     ` Jonathan Cameron
2023-01-16 23:22       ` Marten Lindahl
2023-01-16 23:19     ` Marten Lindahl [this message]
2023-01-14 16:47 ` [PATCH v3 0/3] iio: light: vcnl4000: Add vcnl4040 interrupt support Jonathan Cameron

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=a5851acb-be2b-9d41-8b30-ce5094e34af5@axis.com \
    --to=martenli@axis.com \
    --cc=andriy.shechenko@saunalahti.fi \
    --cc=jic23@kernel.org \
    --cc=kernel@axis.com \
    --cc=lars@metafoo.de \
    --cc=linux-iio@vger.kernel.org \
    --cc=marten.lindahl@axis.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox