regmap: regcache-rbtree: Fixed node range check on sync
Subsystems (2)
PATCH 1/1 regmap: regcache-rbtree: Fixed node range check on sync
Hi,
This patch fixes what I think is a bug in regcache_rbtree_sync(). It is something I noticed when reading the code, I don't have a test scenario for it. So please review it carefully.
Bye,
Maarten
PATCH 1/1 regmap: regcache-rbtree: Fixed node range check on sync
A node starting before the minimum register is no reason to reject it, since its end could be in range. The check for the end already exists two lines lower, so we can just remove the incorrect check.
Signed-off-by Maarten ter Huurne <[email protected]>
--- drivers/base/regmap/regcache-rbtree.c | 2 -- 1 file changed, 2 deletions(-)
drivers/base/regmap/regcache-rbtree.c +0 -2
@@ -385,8 +385,6 @@ static int regcache_rbtree_sync(struct regmap *map, unsigned int min,for (node =rb_first (&rbtree_ctx->root); node; node =rb_next (node)) { rbnode = rb_entry(node, struct regcache_rbtree_node, node); -if (rbnode->base_reg < min) -continue ;if (rbnode->base_reg > max)break ;if (rbnode->base_reg + rbnode->blklen < min)
Signature · 1 line
1.7.10.4
Quoted 3 lines · Maarten ter Huurne
A node starting before the minimum register is no reason to reject it, since its end could be in range. The check for the end already exists two lines lower, so we can just remove the incorrect check.
Applied, thanks.