public inbox for linux-iio@vger.kernel.org
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter@oracle.com>
To: sathyanarayanan.kuppuswamy@linux.intel.com
Cc: linux-iio@vger.kernel.org
Subject: re: iio: ltr501: Add interrupt support
Date: Tue, 12 May 2015 21:09:41 +0300	[thread overview]
Message-ID: <20150512180941.GD5672@mwanda> (raw)

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?

   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

             reply	other threads:[~2015-05-12 18:09 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-05-12 18:09 Dan Carpenter [this message]
2015-05-12 20:56 ` iio: ltr501: Add interrupt support sathyanarayanan kuppuswamy

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=20150512180941.GD5672@mwanda \
    --to=dan.carpenter@oracle.com \
    --cc=linux-iio@vger.kernel.org \
    --cc=sathyanarayanan.kuppuswamy@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