[PATCH RFC 2/2] regmap: move to using BITS_MASK macro

From: srinivas.kandagatla
Date: Thu Oct 31 2013 - 08:03:13 EST


From: Srinivas Kandagatla <srinivas.kandagatla@xxxxxx>

This patch uses the new BITS_MASK macro for generating mask for multiple
bits.

Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@xxxxxx>
---
drivers/base/regmap/regmap.c | 3 +--
1 files changed, 1 insertions(+), 2 deletions(-)

diff --git a/drivers/base/regmap/regmap.c b/drivers/base/regmap/regmap.c
index 7d689a1..7433939 100644
--- a/drivers/base/regmap/regmap.c
+++ b/drivers/base/regmap/regmap.c
@@ -816,11 +816,10 @@ EXPORT_SYMBOL_GPL(devm_regmap_init);
static void regmap_field_init(struct regmap_field *rm_field,
struct regmap *regmap, struct reg_field reg_field)
{
- int field_bits = reg_field.msb - reg_field.lsb + 1;
rm_field->regmap = regmap;
rm_field->reg = reg_field.reg;
rm_field->shift = reg_field.lsb;
- rm_field->mask = ((BIT(field_bits) - 1) << reg_field.lsb);
+ rm_field->mask = BITS_MASK(reg_field.lsb, reg_field.msb);
}

/**
--
1.7.6.5

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/