linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jonathan Cameron <jic23@kernel.org>
To: Sergey Efimochkin <sergeyanton2007@gmail.com>
Cc: dan.carpenter@oracle.com,
	Sergey Efimochkin <efimochkin.sv@phystech.edu>,
	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 v2] staging: iio: adc: ad7280a: fix codestyle in ad7280_event_handler
Date: Sat, 22 Dec 2018 17:04:07 +0000	[thread overview]
Message-ID: <20181222170407.36530c12@archlinux> (raw)
In-Reply-To: <20181217220602.89406-1-efimochkin.sv@phystech.edu>

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

> staging: iio: adc: ad7280a: fix codestyle in ad7280_event_handler
> Signed-off-by: Sergey Efimochkin <efimochkin.sv@phystech.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),


      reply	other threads:[~2018-12-22 17:04 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-12-17  1:43 [PATCH] staging:iio:adc: fix codestyle Sergey Efimochkin
2018-12-17  7:45 ` Dan Carpenter
2018-12-17 22:06   ` [PATCH v2] staging: iio: adc: ad7280a: fix codestyle in ad7280_event_handler Sergey Efimochkin
2018-12-22 17:04     ` Jonathan Cameron [this message]

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=20181222170407.36530c12@archlinux \
    --to=jic23@kernel.org \
    --cc=Michael.Hennerich@analog.com \
    --cc=dan.carpenter@oracle.com \
    --cc=devel@driverdev.osuosl.org \
    --cc=efimochkin.sv@phystech.edu \
    --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=sergeyanton2007@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).