public inbox for linux-iio@vger.kernel.org
 help / color / mirror / Atom feed
From: sathyanarayanan kuppuswamy <sathyanarayanan.kuppuswamy@linux.intel.com>
To: Dan Carpenter <dan.carpenter@oracle.com>
Cc: linux-iio@vger.kernel.org
Subject: Re: iio: ltr501: Add interrupt support
Date: Tue, 12 May 2015 13:56:46 -0700	[thread overview]
Message-ID: <5552690E.3060006@linux.intel.com> (raw)
In-Reply-To: <20150512180941.GD5672@mwanda>

Hi

On 05/12/2015 11:09 AM, Dan Carpenter wrote:
> Hello Kuppuswamy Sathyanarayanan,
>
> The patch 7ac702b3144b: "iio: ltr501: Add interrupt support" from Apr
> 19, 2015, leads to the following static checker warning:
>
> 	drivers/iio/light/ltr501.c:869 ltr501_write_thresh()
> 	info: ignoring unreachable code.
>
> drivers/iio/light/ltr501.c
>     867          case IIO_PROXIMITY:
>     868                  switch (dir) {
>     869                  if (val > LTR501_PS_THRESH_MASK)
>     870                          return -EINVAL;
>
> Probably this code should be outside of this switch (dir) statement?
Agreed. I will send a patch with fix soon.
>
>     871                  case IIO_EV_DIR_RISING:
>     872                          mutex_lock(&data->lock_ps);
>     873                          ret = regmap_bulk_write(data->regmap,
>     874                                                  LTR501_PS_THRESH_UP,
>     875                                                  &val, 2);
>     876                          mutex_unlock(&data->lock_ps);
>     877                          return ret;
>     878                  case IIO_EV_DIR_FALLING:
>     879                          mutex_lock(&data->lock_ps);
>     880                          ret = regmap_bulk_write(data->regmap,
>     881                                                  LTR501_PS_THRESH_LOW,
>     882                                                  &val, 2);
>     883                          mutex_unlock(&data->lock_ps);
>     884                          return ret;
>     885                  default:
>     886                          return -EINVAL;
>     887                  }
>     888          default:
>     889                  return -EINVAL;
>     890          }
>     891
>     892          return -EINVAL;
>     893  }
>
> regards,
> dan carpenter
> --
> To unsubscribe from this list: send the line "unsubscribe linux-iio" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>

-- 
Sathyanarayanan Kuppuswamy
Android kernel developer


      reply	other threads:[~2015-05-12 20:57 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-05-12 18:09 iio: ltr501: Add interrupt support Dan Carpenter
2015-05-12 20:56 ` sathyanarayanan kuppuswamy [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=5552690E.3060006@linux.intel.com \
    --to=sathyanarayanan.kuppuswamy@linux.intel.com \
    --cc=dan.carpenter@oracle.com \
    --cc=linux-iio@vger.kernel.org \
    /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