public inbox for linux-iio@vger.kernel.org
 help / color / mirror / Atom feed
From: Jonathan Cameron <jic23@kernel.org>
To: Kuppuswamy Sathyanarayanan
	<sathyanarayanan.kuppuswamy@linux.intel.com>,
	pmeerw@pmeerw.net
Cc: srinivas.pandruvada@linux.intel.com,
	linux-kernel@vger.kernel.org, linux-iio@vger.kernel.org
Subject: Re: [PATCH v1 1/1] iio: ltr501: Fix proximity threshold boundary check
Date: Sat, 16 May 2015 11:09:26 +0100	[thread overview]
Message-ID: <55571756.2070909@kernel.org> (raw)
In-Reply-To: <7acfd1ed6ffbaab2f64e77ef1959c7ce86161173.1431732634.git.sathyanarayanan.kuppuswamy@linux.intel.com>

On 16/05/15 00:42, Kuppuswamy Sathyanarayanan wrote:
> Currently, proximity sensor boundary check is done
> inside the switch block but outside the case
> statement.Since this code will never get executed,
> moved the check outside the switch case statement.
> 
>    867          case IIO_PROXIMITY:
>    868                  switch (dir) {
>    // Following line has been moved outside the switch block.
>    869                  if (val > LTR501_PS_THRESH_MASK)
>    870                          return -EINVAL;
>    871                  case IIO_EV_DIR_RISING:
> 
> Signed-off-by: Kuppuswamy Sathyanarayanan <sathyanarayanan.kuppuswamy@linux.intel.com>
Applied to the togreg branch of iio.git

Thanks,

Jonathan
> ---
>  drivers/iio/light/ltr501.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/iio/light/ltr501.c b/drivers/iio/light/ltr501.c
> index ca4bf47..417369b 100644
> --- a/drivers/iio/light/ltr501.c
> +++ b/drivers/iio/light/ltr501.c
> @@ -865,9 +865,9 @@ static int ltr501_write_thresh(struct iio_dev *indio_dev,
>  			return -EINVAL;
>  		}
>  	case IIO_PROXIMITY:
> -		switch (dir) {
>  		if (val > LTR501_PS_THRESH_MASK)
>  			return -EINVAL;
> +		switch (dir) {
>  		case IIO_EV_DIR_RISING:
>  			mutex_lock(&data->lock_ps);
>  			ret = regmap_bulk_write(data->regmap,
> 


      reply	other threads:[~2015-05-16 10:09 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-05-15 23:42 [PATCH v1 1/1] iio: ltr501: Fix proximity threshold boundary check Kuppuswamy Sathyanarayanan
2015-05-16 10:09 ` Jonathan Cameron [this message]

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=55571756.2070909@kernel.org \
    --to=jic23@kernel.org \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=pmeerw@pmeerw.net \
    --cc=sathyanarayanan.kuppuswamy@linux.intel.com \
    --cc=srinivas.pandruvada@linux.intel.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