提交 33300571 编写于 作者: A Axel Lin 提交者: 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: NAxel Lin <axel.lin@gmail.com>
Signed-off-by: NGrant Likely <grant.likely@secretlab.ca>
上级 a57339b4
......@@ -233,7 +233,7 @@ static int __devinit ioh_gpio_probe(struct pci_dev *pdev,
return 0;
err_gpiochip_add:
for (; i != 0; i--) {
while (--i >= 0) {
chip--;
ret = gpiochip_remove(&chip->gpio);
if (ret)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册