All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jonathan Cameron <jic23@kernel.org>
To: Cristian Sicilia <sicilia.cristian@gmail.com>
Cc: Lars-Peter Clausen <lars@metafoo.de>,
	Michael Hennerich <Michael.Hennerich@analog.com>,
	Hartmut Knaack <knaack.h@gmx.de>,
	Peter Meerwald-Stadler <pmeerw@pmeerw.net>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	linux-iio@vger.kernel.org, devel@driverdev.osuosl.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH v3 4/5] staging: iio: adc: ad7280a: Adding temp var to improve readability
Date: Sun, 31 Mar 2019 10:35:15 +0100	[thread overview]
Message-ID: <20190331103515.019d3501@archlinux> (raw)
In-Reply-To: <1d398f3efc0191776b3329f30742b07b6baaa530.1553447138.git.sicilia.cristian@gmail.com>

On Sun, 24 Mar 2019 18:23:14 +0100
Cristian Sicilia <sicilia.cristian@gmail.com> wrote:

> Creating a temporary variable to improve readability
> 
> Signed-off-by: Cristian Sicilia <sicilia.cristian@gmail.com>
I have already applied this one.

Thanks,

Jonathan

> ---
>  drivers/staging/iio/adc/ad7280a.c | 55 ++++++++++++++++++---------------------
>  1 file changed, 25 insertions(+), 30 deletions(-)
> 
> diff --git a/drivers/staging/iio/adc/ad7280a.c b/drivers/staging/iio/adc/ad7280a.c
> index c2391f6..4ff28f1 100644
> --- a/drivers/staging/iio/adc/ad7280a.c
> +++ b/drivers/staging/iio/adc/ad7280a.c
> @@ -784,43 +784,38 @@ static irqreturn_t ad7280_event_handler(int irq, void *private)
>  	for (i = 0; i < st->scan_cnt; i++) {
>  		if (((channels[i] >> 23) & 0xF) <= AD7280A_CELL_VOLTAGE_6) {
>  			if (((channels[i] >> 11) & 0xFFF) >=
> -				st->cell_threshhigh)
> -				iio_push_event(indio_dev,
> -					       IIO_EVENT_CODE(IIO_VOLTAGE,
> -							1,
> -							0,
> -							IIO_EV_DIR_RISING,
> -							IIO_EV_TYPE_THRESH,
> -							0, 0, 0),
> +			    st->cell_threshhigh) {
> +				u64 tmp = IIO_EVENT_CODE(IIO_VOLTAGE, 1, 0,
> +							 IIO_EV_DIR_RISING,
> +							 IIO_EV_TYPE_THRESH,
> +							 0, 0, 0);
> +				iio_push_event(indio_dev, tmp,
>  					       iio_get_time_ns(indio_dev));
> -			else if (((channels[i] >> 11) & 0xFFF) <=
> -				st->cell_threshlow)
> -				iio_push_event(indio_dev,
> -					       IIO_EVENT_CODE(IIO_VOLTAGE,
> -							1,
> -							0,
> -							IIO_EV_DIR_FALLING,
> -							IIO_EV_TYPE_THRESH,
> -							0, 0, 0),
> +			} else if (((channels[i] >> 11) & 0xFFF) <=
> +				   st->cell_threshlow) {
> +				u64 tmp = IIO_EVENT_CODE(IIO_VOLTAGE, 1, 0,
> +							 IIO_EV_DIR_FALLING,
> +							 IIO_EV_TYPE_THRESH,
> +							 0, 0, 0);
> +				iio_push_event(indio_dev, tmp,
>  					       iio_get_time_ns(indio_dev));
> +			}
>  		} else {
> -			if (((channels[i] >> 11) & 0xFFF) >= st->aux_threshhigh)
> -				iio_push_event(indio_dev,
> -					       IIO_UNMOD_EVENT_CODE(
> -							IIO_TEMP,
> -							0,
> +			if (((channels[i] >> 11) & 0xFFF) >=
> +			    st->aux_threshhigh) {
> +				u64 tmp = IIO_UNMOD_EVENT_CODE(IIO_TEMP, 0,
>  							IIO_EV_TYPE_THRESH,
> -							IIO_EV_DIR_RISING),
> +							IIO_EV_DIR_RISING);
> +				iio_push_event(indio_dev, tmp,
>  					       iio_get_time_ns(indio_dev));
> -			else if (((channels[i] >> 11) & 0xFFF) <=
> -				st->aux_threshlow)
> -				iio_push_event(indio_dev,
> -					       IIO_UNMOD_EVENT_CODE(
> -							IIO_TEMP,
> -							0,
> +			} else if (((channels[i] >> 11) & 0xFFF) <=
> +				st->aux_threshlow) {
> +				u64 tmp = IIO_UNMOD_EVENT_CODE(IIO_TEMP, 0,
>  							IIO_EV_TYPE_THRESH,
> -							IIO_EV_DIR_FALLING),
> +							IIO_EV_DIR_FALLING);
> +				iio_push_event(indio_dev, tmp,
>  					       iio_get_time_ns(indio_dev));
> +			}
>  		}
>  	}
>  


  reply	other threads:[~2019-03-31  9:35 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-03-23 12:53 [PATCH 0/5] *** SUBJECT HERE *** Cristian Sicilia
2019-03-23 12:53 ` [PATCH 3/5] staging: iio: adc: Avoid precedence issues in macro Cristian Sicilia
2019-03-23 12:53 ` [PATCH 4/5] staging: iio: adc: Adding temp var to improve readability Cristian Sicilia
2019-03-23 12:54 ` [PATCH 2/5] staging: iio: adc: Converted bool to bitfield format Cristian Sicilia
2019-03-23 12:54 ` [PATCH 5/5] staging: iio: adc: Remove CamelCase notation Cristian Sicilia
2019-03-23 12:58 ` [PATCH 1/5] staging: iio: adc: Tab alignment Cristian Sicilia
2019-03-23 19:21 ` [PATCH v2 0/5] staging: iio: adc: Code refactoring and bool to bitfield change Cristian Sicilia
2019-03-23 19:21   ` [PATCH v2 1/5] staging: iio: adc: Tab alignment Cristian Sicilia
2019-03-24 12:35     ` Jonathan Cameron
2019-03-24 16:34       ` Cristian Sicilia
2019-03-23 19:21   ` [PATCH v2 2/5] staging: iio: adc: Converted bool to bitfield format Cristian Sicilia
2019-03-24 12:34     ` Jonathan Cameron
2019-03-24 16:33       ` Sicilia Cristian
2019-03-23 19:21   ` [PATCH v2 3/5] staging: iio: adc: Avoid precedence issues in macro Cristian Sicilia
2019-03-24 12:37     ` Jonathan Cameron
2019-03-23 19:21   ` [PATCH v2 4/5] staging: iio: adc: Adding temp var to improve readability Cristian Sicilia
2019-03-24 12:41     ` Jonathan Cameron
2019-03-23 19:21   ` [PATCH v2 5/5] staging: iio: adc: Remove CamelCase notation Cristian Sicilia
2019-03-24 14:56     ` Jonathan Cameron
2019-03-24 17:23   ` [PATCH v2 0/5] staging: iio: adc: Code refactoring and bool to bitfield change Cristian Sicilia
2019-03-24 17:27     ` [PATCH v3 " Cristian Sicilia
2019-03-24 17:23     ` [PATCH v3 1/5] staging: iio: adc: ad7280a: Tab alignment Cristian Sicilia
2019-03-31  9:29       ` Jonathan Cameron
2019-03-24 17:23     ` [PATCH v3 2/5] staging: iio: adc: ad7192: Converted bool to bitfield format Cristian Sicilia
2019-03-31  9:32       ` Jonathan Cameron
2019-03-24 17:23     ` [PATCH v3 3/5] staging: iio: adc: ad7280a: Avoid precedence issues in macro Cristian Sicilia
2019-03-31  9:34       ` Jonathan Cameron
2019-03-24 17:23     ` [PATCH v3 4/5] staging: iio: adc: ad7280a: Adding temp var to improve readability Cristian Sicilia
2019-03-31  9:35       ` Jonathan Cameron [this message]
2019-03-31  9:35       ` Jonathan Cameron
2019-03-24 17:23     ` [PATCH v3 5/5] staging: iio: adc: ad7280a: Remove CamelCase notation Cristian Sicilia
2019-03-31  9:37       ` Jonathan Cameron
2019-03-23 19:24 ` [PATCH 0/5] *** SUBJECT HERE *** Matt Ranostay

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=20190331103515.019d3501@archlinux \
    --to=jic23@kernel.org \
    --cc=Michael.Hennerich@analog.com \
    --cc=devel@driverdev.osuosl.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=knaack.h@gmx.de \
    --cc=lars@metafoo.de \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=pmeerw@pmeerw.net \
    --cc=sicilia.cristian@gmail.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 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.