diff options
author | Mark Brown <broonie@kernel.org> | 2023-04-04 22:42:28 +0300 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2023-04-05 13:39:58 +0300 |
commit | fac79bad889bb167a37492181646992c8c48903b (patch) | |
tree | 6034dcc278cf70e391656b860d4a60d69cc20af8 /drivers/base | |
parent | 451941ac1ee2be125ac5029593a64b04badaa314 (diff) | |
download | linux-fac79bad889bb167a37492181646992c8c48903b.tar.xz |
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>
Diffstat (limited to 'drivers/base')
-rw-r--r-- | drivers/base/regmap/regcache-maple.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/base/regmap/regcache-maple.c b/drivers/base/regmap/regcache-maple.c index 20fb7228fc6b..9b1b559107ef 100644 --- a/drivers/base/regmap/regcache-maple.c +++ b/drivers/base/regmap/regcache-maple.c @@ -22,7 +22,7 @@ static int regcache_maple_read(struct regmap *map, rcu_read_lock(); - entry = mas_find(&mas, reg); + entry = mas_walk(&mas); if (!entry) { rcu_read_unlock(); return -ENOENT; @@ -47,7 +47,7 @@ static int regcache_maple_write(struct regmap *map, unsigned int reg, rcu_read_lock(); - entry = mas_find(&mas, reg); + entry = mas_walk(&mas); if (entry) { entry[reg - mas.index] = val; rcu_read_unlock(); |