Commit e7c3d054 authored by Payal Kshirsagar's avatar Payal Kshirsagar Committed by Greg Kroah-Hartman

staging: iio: adc: ad7816.c: Replace bit shifting with BIT macro

Challenge suggested by coccinelle.
Prefer using BIT and replace bit shifting with the BIT(x) macro.
Signed-off-by: default avatarPayal Kshirsagar <payal.s.kshirsagar.98@gmail.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 6082ac04
...@@ -231,7 +231,7 @@ static ssize_t ad7816_show_value(struct device *dev, ...@@ -231,7 +231,7 @@ static ssize_t ad7816_show_value(struct device *dev,
value = (s8)((data >> AD7816_TEMP_FLOAT_OFFSET) - 103); value = (s8)((data >> AD7816_TEMP_FLOAT_OFFSET) - 103);
data &= AD7816_TEMP_FLOAT_MASK; data &= AD7816_TEMP_FLOAT_MASK;
if (value < 0) 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, "%d.%.2d\n", value, data * 25);
} }
return sprintf(buf, "%u\n", data); return sprintf(buf, "%u\n", data);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment