diff options
author | Axel Lin <axel.lin@gmail.com> | 2011-06-14 07:12:57 -0400 |
---|---|---|
committer | Grant Likely <grant.likely@secretlab.ca> | 2011-06-16 15:44:29 -0400 |
commit | 33300571b1111264fd0c5701733f7576323f3e35 (patch) | |
tree | d28ef4ba45085ef706522ec0930088f8f15b468c | |
parent | a57339b4b5daf23b4cec450b37906d5f8b5fa722 (diff) |
gpio/ml-ioh: fix off-by-one for displaying variable i in dev_err
with the "for (; i != 0; i--)" sytax, i-- will be executed after the iteration.
thus dev_err shows wrong i value.
Switch to "while(--i >= 0)" which is better in readability.
Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
-rw-r--r-- | drivers/gpio/gpio-ml-ioh.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/gpio/gpio-ml-ioh.c b/drivers/gpio/gpio-ml-ioh.c index 1bc621ac3536..a9016f56ed7e 100644 --- a/drivers/gpio/gpio-ml-ioh.c +++ b/drivers/gpio/gpio-ml-ioh.c | |||
@@ -233,7 +233,7 @@ static int __devinit ioh_gpio_probe(struct pci_dev *pdev, | |||
233 | return 0; | 233 | return 0; |
234 | 234 | ||
235 | err_gpiochip_add: | 235 | err_gpiochip_add: |
236 | for (; i != 0; i--) { | 236 | while (--i >= 0) { |
237 | chip--; | 237 | chip--; |
238 | ret = gpiochip_remove(&chip->gpio); | 238 | ret = gpiochip_remove(&chip->gpio); |
239 | if (ret) | 239 | if (ret) |