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: <20241204013620.862943-3-andriy.shevchenko@linux.intel.com>
Date: Wed,  4 Dec 2024 03:33:17 +0200
From: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
To: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>,
	linux-iio@...r.kernel.org,
	linux-kernel@...r.kernel.org
Cc: Peter Rosin <peda@...ntia.se>,
	Jonathan Cameron <jic23@...nel.org>,
	Lars-Peter Clausen <lars@...afoo.de>
Subject: [PATCH v1 2/4] iio: afe: rescale: Don't use ULL(1) << x instead of BIT(x)

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@...ux.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@...ntia.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


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ