2013-05-31 14:45:49

by Maarten ter Huurne

[permalink] [raw]
Subject: [PATCH] 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


2013-05-31 14:50:31

by Maarten ter Huurne

[permalink] [raw]
Subject: [PATCH] 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(-)

diff --git a/drivers/base/regmap/regcache-rbtree.c b/drivers/base/regmap/regcache-rbtree.c
index 79f4fca..bd57ed4 100644
--- a/drivers/base/regmap/regcache-rbtree.c
+++ b/drivers/base/regmap/regcache-rbtree.c
@@ -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)
--
1.7.10.4

2013-06-01 19:10:34

by Mark Brown

[permalink] [raw]
Subject: Re: [PATCH] regmap: regcache-rbtree: Fixed node range check on sync

On Fri, May 31, 2013 at 04:45:13PM +0200, Maarten ter Huurne wrote:
> 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.


Attachments:
(No filename) (293.00 B)
signature.asc (836.00 B)
Digital signature
Download all attachments