提交 5d44b414 编写于 作者: H Harvey Harrison 提交者: Jeff Garzik

ata: fix sparse warning in libata.h

Avoids lots of these, also is more readable.
include/linux/libata.h:1210:13: warning: potentially expensive pointer subtraction

Change the subtraction to addition on the other side of the comparison.

Thanks to Christer Weinigel for the suggestion.
Signed-off-by: NHarvey Harrison <harvey.harrison@gmail.com>
Acked-by: NTejun Heo <htejun@gmail.com>
Signed-off-by: NJeff Garzik <jeff@garzik.org>
上级 33267325
......@@ -1197,7 +1197,7 @@ static inline struct ata_link *ata_port_next_link(struct ata_link *link)
return ap->pmp_link;
}
if (++link - ap->pmp_link < ap->nr_pmp_links)
if (++link < ap->nr_pmp_links + ap->pmp_link)
return link;
return NULL;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册