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: <74ee6d155e15fbfe06512c7caa52f1575727402e.1454913458.git.bhumirks@gmail.com>
Date:	Mon,  8 Feb 2016 12:18:56 +0530
From:	Bhumika Goyal <bhumirks@...il.com>
To:	lars@...afoo.de, gregkh@...uxfoundation.org,
	Michael.Hennerich@...log.com, jic23@...nel.org, knaack.h@....de,
	pmeerw@...erw.net
Cc:	linux-iio@...r.kernel.org, devel@...verdev.osuosl.org,
	linux-kernel@...r.kernel.org, Bhumika Goyal <bhumirks@...il.com>
Subject: [PATCH 1/2] Staging:iio:Prefer using BIT macro

This patch replaces bit shifting on 1 with the BIT(x) macro.
This was done with coccinelle:
 @@ int g; @@
-(1 << g)
+BIT(g)

Signed-off-by: Bhumika Goyal <bhumirks@...il.com>
---
 drivers/staging/iio/adc/ad7816.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/iio/adc/ad7816.c b/drivers/staging/iio/adc/ad7816.c
index 2226051..f631012 100644
--- a/drivers/staging/iio/adc/ad7816.c
+++ b/drivers/staging/iio/adc/ad7816.c
@@ -222,7 +222,7 @@ static ssize_t ad7816_show_value(struct device *dev,
 		value = (s8)((data >> AD7816_TEMP_FLOAT_OFFSET) - 103);
 		data &= AD7816_TEMP_FLOAT_MASK;
 		if (value < 0)
-			data = (1 << AD7816_TEMP_FLOAT_OFFSET) - data;
+			data = BIT(AD7816_TEMP_FLOAT_OFFSET) - data;
 		return sprintf(buf, "%d.%.2d\n", value, data * 25);
 	}
 	return sprintf(buf, "%u\n", data);
-- 
1.9.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ