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] [day] [month] [year] [list]
Date:   Sat, 22 Dec 2018 17:04:07 +0000
From:   Jonathan Cameron <jic23@...nel.org>
To:     Sergey Efimochkin <sergeyanton2007@...il.com>
Cc:     dan.carpenter@...cle.com,
        Sergey Efimochkin <efimochkin.sv@...stech.edu>,
        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 v2] staging: iio: adc: ad7280a: fix codestyle in
 ad7280_event_handler

On Tue, 18 Dec 2018 01:06:01 +0300
Sergey Efimochkin <sergeyanton2007@...il.com> wrote:

> staging: iio: adc: ad7280a: fix codestyle in ad7280_event_handler
> Signed-off-by: Sergey Efimochkin <efimochkin.sv@...stech.edu>
Hi,

I wouldn't say this is a real improvement on readability.
If you are really determined to 'fix it', then I would suggest introducing
local variables, and only having a single call to iio_push_event for all
the deeply nested cases (well one per channel anyway).

Jonathan

> ---
> Changes in v2:
> - changed patch prefix
> - changed patch description
> - removed incorrect fixes to codestyle
>  drivers/staging/iio/adc/ad7280a.c | 6 ++----
>  1 file changed, 2 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/staging/iio/adc/ad7280a.c b/drivers/staging/iio/adc/ad7280a.c
> index 58420dcb406d..f167ee1b2127 100644
> --- a/drivers/staging/iio/adc/ad7280a.c
> +++ b/drivers/staging/iio/adc/ad7280a.c
> @@ -725,8 +725,7 @@ static irqreturn_t ad7280_event_handler(int irq, void *private)
>  		} else {
>  			if (((channels[i] >> 11) & 0xFFF) >= st->aux_threshhigh)
>  				iio_push_event(indio_dev,
> -					       IIO_UNMOD_EVENT_CODE(
> -							IIO_TEMP,
> +					       IIO_UNMOD_EVENT_CODE(IIO_TEMP,
>  							0,
>  							IIO_EV_TYPE_THRESH,
>  							IIO_EV_DIR_RISING),
> @@ -734,8 +733,7 @@ static irqreturn_t ad7280_event_handler(int irq, void *private)
>  			else if (((channels[i] >> 11) & 0xFFF) <=
>  				st->aux_threshlow)
>  				iio_push_event(indio_dev,
> -					       IIO_UNMOD_EVENT_CODE(
> -							IIO_TEMP,
> +					       IIO_UNMOD_EVENT_CODE(IIO_TEMP,
>  							0,
>  							IIO_EV_TYPE_THRESH,
>  							IIO_EV_DIR_FALLING),

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ