2012-05-22 22:20:21

by Guennadi Liakhovetski

[permalink] [raw]
Subject: [PATCH] pinctrl: fix a minor harmless typo

The way the for_each_maps() macro is currently used, using "i" instead of
"_i_" works and is harmless. Still, this is a bug, that can trigger any
time, if the code around that macro changes. Better fix it now.

Signed-off-by: Guennadi Liakhovetski <[email protected]>
---
diff --git a/drivers/pinctrl/core.c b/drivers/pinctrl/core.c
index ec3b8cc18..4e768d4 100644
--- a/drivers/pinctrl/core.c
+++ b/drivers/pinctrl/core.c
@@ -57,7 +57,7 @@ static LIST_HEAD(pinctrl_maps);
list_for_each_entry(_maps_node_, &pinctrl_maps, node) \
for (_i_ = 0, _map_ = &_maps_node_->maps[_i_]; \
_i_ < _maps_node_->num_maps; \
- i++, _map_ = &_maps_node_->maps[_i_])
+ _i_++, _map_ = &_maps_node_->maps[_i_])

/**
* pinctrl_provide_dummies() - indicate if pinctrl provides dummy state support


2012-05-23 14:52:34

by Stephen Warren

[permalink] [raw]
Subject: Re: [PATCH] pinctrl: fix a minor harmless typo

On 05/22/2012 04:20 PM, Guennadi Liakhovetski wrote:
> The way the for_each_maps() macro is currently used, using "i" instead of
> "_i_" works and is harmless. Still, this is a bug, that can trigger any
> time, if the code around that macro changes. Better fix it now.
>
> Signed-off-by: Guennadi Liakhovetski <[email protected]>

Clearly correct,
Acked-by: Stephen Warren <[email protected]>

2012-05-24 15:07:28

by Linus Walleij

[permalink] [raw]
Subject: Re: [PATCH] pinctrl: fix a minor harmless typo

On Wed, May 23, 2012 at 12:20 AM, Guennadi Liakhovetski
<[email protected]> wrote:

> The way the for_each_maps() macro is currently used, using "i" instead of
> "_i_" works and is harmless. Still, this is a bug, that can trigger any
> time, if the code around that macro changes. Better fix it now.
>
> Signed-off-by: Guennadi Liakhovetski <[email protected]>

Thanks! Applied with Stephen's ACK.

Yours,
Linus Walleij