All of lore.kernel.org
 help / color / mirror / Atom feed
From: Hartmut Knaack <knaack.h@gmx.de>
To: linux-iio@vger.kernel.org
Cc: Jonathan Cameron <jic23@kernel.org>,
	Lars-Peter Clausen <lars@metafoo.de>
Subject: [PATCH 3/6] staging:iio:ad7291 fix ad7291_threshold_reg()
Date: Tue, 08 Jul 2014 13:06:53 +0200	[thread overview]
Message-ID: <53BBD0CD.3030203@gmx.de> (raw)

ad7291_threshold_reg() should return the register number of a threshold
register, and thus be safe without handling a default case.

Signed-off-by: Hartmut Knaack <knaack.h@gmx.de>
---
diff --git a/drivers/staging/iio/adc/ad7291.c b/drivers/staging/iio/adc/ad7291.c
index f5d29ef..b868c64 100644
--- a/drivers/staging/iio/adc/ad7291.c
+++ b/drivers/staging/iio/adc/ad7291.c
@@ -174,8 +174,6 @@ static unsigned int ad7291_threshold_reg(const struct iio_chan_spec *chan,
 	case IIO_TEMP:
 		offset = 8;
 		break;
-	default:
-	    return 0;
 	}
 
 	switch (info) {
@@ -186,10 +184,7 @@ static unsigned int ad7291_threshold_reg(const struct iio_chan_spec *chan,
 			return AD7291_DATA_LOW(offset);
 	case IIO_EV_INFO_HYSTERESIS:
 		return AD7291_HYST(offset);
-	default:
-		break;
 	}
-	return 0;
 }
 
 static int ad7291_read_event_value(struct iio_dev *indio_dev,

             reply	other threads:[~2014-07-08 11:06 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-07-08 11:06 Hartmut Knaack [this message]
2014-07-08 20:10 ` [PATCH 3/6] staging:iio:ad7291 fix ad7291_threshold_reg() 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=53BBD0CD.3030203@gmx.de \
    --to=knaack.h@gmx.de \
    --cc=jic23@kernel.org \
    --cc=lars@metafoo.de \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.