Skip to contentSkip to conversation

regmap: regcache-rbtree: Fixed node range check on sync

PATCH New Maarten ter Huurne 2 participants 3 messages May 31, 2013 – Jun 1, 2013

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

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

#1 lore raw

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.

---
 drivers/base/regmap/regcache-rbtree.c |    2 --
 1 file changed, 2 deletions(-)
drivers/base/regmap/regcache-rbtree.c +0 -2
index 79f4fca..bd57ed4 100644
@@ -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
maintainer Applied
#2 lore raw
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.