Skip to content

Commit fac79ba

Browse files
committed
regmap: Use mas_walk() instead of mas_find()
Liam recommends using mas_walk() instead of mas_find() for our use case so let's do that, it avoids some minor overhead associated with being able to restart the operation which we don't need since we do a simple search. Suggested-by: Liam R. Howlett <Liam.Howlett@Oracle.com> Signed-off-by: Mark Brown <broonie@kernel.org> Link: https://lore.kernel.org/r/20230403-regmap-maple-walk-fine-v2-1-c07371c8a867@kernel.org Signed-off-by: Mark Brown <broonie@kernel.org>
1 parent 451941a commit fac79ba

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

drivers/base/regmap/regcache-maple.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ static int regcache_maple_read(struct regmap *map,
2222

2323
rcu_read_lock();
2424

25-
entry = mas_find(&mas, reg);
25+
entry = mas_walk(&mas);
2626
if (!entry) {
2727
rcu_read_unlock();
2828
return -ENOENT;
@@ -47,7 +47,7 @@ static int regcache_maple_write(struct regmap *map, unsigned int reg,
4747

4848
rcu_read_lock();
4949

50-
entry = mas_find(&mas, reg);
50+
entry = mas_walk(&mas);
5151
if (entry) {
5252
entry[reg - mas.index] = val;
5353
rcu_read_unlock();

0 commit comments

Comments
 (0)