lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20190331103549.1d98378e@archlinux>
Date:   Sun, 31 Mar 2019 10:35:49 +0100
From:   Jonathan Cameron <jic23@...nel.org>
To:     Cristian Sicilia <sicilia.cristian@...il.com>
Cc:     Lars-Peter Clausen <lars@...afoo.de>,
        Michael Hennerich <Michael.Hennerich@...log.com>,
        Hartmut Knaack <knaack.h@....de>,
        Peter Meerwald-Stadler <pmeerw@...erw.net>,
        Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
        linux-iio@...r.kernel.org, devel@...verdev.osuosl.org,
        linux-kernel@...r.kernel.org
Subject: Re: [PATCH v3 4/5] staging: iio: adc: ad7280a: Adding temp var to
 improve readability

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

> Creating a temporary variable to improve readability
> 
> Signed-off-by: Cristian Sicilia <sicilia.cristian@...il.com>
Already applied this one as well.

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));
> +			}
>  		}
>  	}
>  

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ