Linux IIO development
 help / color / mirror / Atom feed
From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
To: Andy Shevchenko <andriy.shevchenko@linux.intel.com>,
	linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org
Cc: Peter Rosin <peda@axentia.se>,
	Jonathan Cameron <jic23@kernel.org>,
	Lars-Peter Clausen <lars@metafoo.de>
Subject: [PATCH v1 2/4] iio: afe: rescale: Don't use ULL(1) << x instead of BIT(x)
Date: Wed,  4 Dec 2024 03:33:17 +0200	[thread overview]
Message-ID: <20241204013620.862943-3-andriy.shevchenko@linux.intel.com> (raw)
In-Reply-To: <20241204013620.862943-1-andriy.shevchenko@linux.intel.com>

ULL(1) << x is just an open-coded implementation of BIT_ULL().
Replace the former by the latter.

Note, the rest of the code properly uses BIT()/BIT_ULL() already.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
 drivers/iio/afe/iio-rescale.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/iio/afe/iio-rescale.c b/drivers/iio/afe/iio-rescale.c
index 470dd7d41b2a..9d33e7aabe4d 100644
--- a/drivers/iio/afe/iio-rescale.c
+++ b/drivers/iio/afe/iio-rescale.c
@@ -8,6 +8,7 @@
  * Author: Peter Rosin <peda@axentia.se>
  */
 
+#include <linux/bits.h>
 #include <linux/err.h>
 #include <linux/gcd.h>
 #include <linux/mod_devicetable.h>
@@ -62,7 +63,7 @@ int rescale_process_scale(struct rescale *rescale, int scale_type,
 		if (scale_type == IIO_VAL_FRACTIONAL)
 			tmp = *val2;
 		else
-			tmp = ULL(1) << *val2;
+			tmp = BIT_ULL(*val2);
 
 		rem2 = *val % (int)tmp;
 		*val = *val / (int)tmp;
-- 
2.43.0.rc1.1336.g36b5255a03ac


  parent reply	other threads:[~2024-12-04  1:36 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-12-04  1:33 [PATCH v1 0/4] iio: afe: rescale: A few cleanups Andy Shevchenko
2024-12-04  1:33 ` [PATCH v1 1/4] iio: afe: rescale: Don't use ^ for booleans Andy Shevchenko
2024-12-06 13:24   ` David Laight
2024-12-06 15:19     ` 'Andy Shevchenko'
2024-12-06 20:13       ` David Laight
2024-12-06 22:27         ` Peter Rosin
2024-12-04  1:33 ` Andy Shevchenko [this message]
2024-12-04  1:33 ` [PATCH v1 3/4] iio: afe: rescale: Re-use generic struct s32_fract Andy Shevchenko
2024-12-04 11:11   ` kernel test robot
2024-12-04 11:32   ` kernel test robot
2024-12-04  1:33 ` [PATCH v1 4/4] iio: afe: rescale: Don't use "proxy" headers Andy Shevchenko

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=20241204013620.862943-3-andriy.shevchenko@linux.intel.com \
    --to=andriy.shevchenko@linux.intel.com \
    --cc=jic23@kernel.org \
    --cc=lars@metafoo.de \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=peda@axentia.se \
    /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