[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1383220441-18519-1-git-send-email-srinivas.kandagatla@st.com>
Date: Thu, 31 Oct 2013 11:54:01 +0000
From: <srinivas.kandagatla@...com>
To: <linux-kernel@...r.kernel.org>
Cc: Mark Brown <broonie@...nel.org>, <srinivas.kandagatla@...com>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>
Subject: [PATCH RFC 2/2] regmap: move to using BITS_MASK macro
From: Srinivas Kandagatla <srinivas.kandagatla@...com>
This patch uses the new BITS_MASK macro for generating mask for multiple
bits.
Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@...com>
---
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@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists