Linux IIO development
 help / color / mirror / Atom feed
From: Andy Shevchenko <andriy.shevchenko@intel.com>
To: Giorgi Tchankvetadze <giorgitchankvetadze1997@gmail.com>
Cc: antoniu.miclaus@analog.com, lars@metafoo.de,
	Michael.Hennerich@analog.com, jic23@kernel.org,
	dlechner@baylibre.com, nuno.sa@analog.com, andy@kernel.org,
	linux-iio@vger.kernel.org
Subject: Re: [PATCH] iio: adc: qcom-spmi-adc5-gen3: remove redundant OR with zero
Date: Thu, 19 Mar 2026 11:20:25 +0200	[thread overview]
Message-ID: <abu_2Y6gjLU1aSHv@ashevche-desk.local> (raw)
In-Reply-To: <abu-21Hi5eXkuGkQ@ashevche-desk.local>

On Thu, Mar 19, 2026 at 11:16:15AM +0200, Andy Shevchenko wrote:
> On Thu, Mar 19, 2026 at 12:57:42PM +0400, Giorgi Tchankvetadze wrote:
> > The expression 'ADC5_GEN3_CHAN_CONV_REQ | 0' is redundant because
> > OR-ing any value with zero does nothing. Remove the pointless '| 0'
> > to simplify the code.
> 
> Have you read the comment above?

...

> >  	 * Use channel 0 by default for immediate conversion and to indicate
> 
> ^^^
> 
> >  	 * there is an actual conversion request
> >  	 */
> 
> I believe this is done for clarity. No need to have this patch, but I won't
> object going it in, since the comment still stays. I leave it to Jonathan,
> but I'm not going to give any tag here.

FWIW to add is that I personally do stuff like this (*) from time to time
and see nothing wrong with the code that gets optimised just at compile-time
even by some dumb and old compilers.

*)
IIRC I have done something like 'foo = BAR | (0 << 20) | BAZ;' for the clarity
of the value that gets into bit 20 of the register.

-- 
With Best Regards,
Andy Shevchenko



  reply	other threads:[~2026-03-19  9:20 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-19  8:57 [PATCH] iio: adc: qcom-spmi-adc5-gen3: remove redundant OR with zero Giorgi Tchankvetadze
2026-03-19  9:16 ` Andy Shevchenko
2026-03-19  9:20   ` Andy Shevchenko [this message]
2026-03-19  9:58     ` Giorgi Tchankvetadze
2026-03-19 19:50   ` 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=abu_2Y6gjLU1aSHv@ashevche-desk.local \
    --to=andriy.shevchenko@intel.com \
    --cc=Michael.Hennerich@analog.com \
    --cc=andy@kernel.org \
    --cc=antoniu.miclaus@analog.com \
    --cc=dlechner@baylibre.com \
    --cc=giorgitchankvetadze1997@gmail.com \
    --cc=jic23@kernel.org \
    --cc=lars@metafoo.de \
    --cc=linux-iio@vger.kernel.org \
    --cc=nuno.sa@analog.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