Commit 33300571 authored by Axel Lin's avatar Axel Lin Committed by Grant Likely

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: default avatarAxel Lin <axel.lin@gmail.com>
Signed-off-by: default avatarGrant Likely <grant.likely@secretlab.ca>
parent a57339b4
...@@ -233,7 +233,7 @@ static int __devinit ioh_gpio_probe(struct pci_dev *pdev, ...@@ -233,7 +233,7 @@ static int __devinit ioh_gpio_probe(struct pci_dev *pdev,
return 0; return 0;
err_gpiochip_add: err_gpiochip_add:
for (; i != 0; i--) { while (--i >= 0) {
chip--; chip--;
ret = gpiochip_remove(&chip->gpio); ret = gpiochip_remove(&chip->gpio);
if (ret) if (ret)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment