aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/libata.h
diff options
context:
space:
mode:
authorHarvey Harrison <harvey.harrison@gmail.com>2008-02-15 13:41:32 -0800
committerJeff Garzik <jeff@garzik.org>2008-02-20 12:12:47 -0500
commit5d44b414daa8c1d8551aed6130d86d54175db43f (patch)
tree8d43b2f5fcdd228ecbf5c7e3fc550d49649ba84d /include/linux/libata.h
parent332673257056d8be8a69d759eda90a799af5472d (diff)
downloadkernel_samsung_smdk4412-5d44b414daa8c1d8551aed6130d86d54175db43f.zip
kernel_samsung_smdk4412-5d44b414daa8c1d8551aed6130d86d54175db43f.tar.gz
kernel_samsung_smdk4412-5d44b414daa8c1d8551aed6130d86d54175db43f.tar.bz2
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: Harvey Harrison <harvey.harrison@gmail.com> Acked-by: Tejun Heo <htejun@gmail.com> Signed-off-by: Jeff Garzik <jeff@garzik.org>
Diffstat (limited to 'include/linux/libata.h')
-rw-r--r--include/linux/libata.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/include/linux/libata.h b/include/linux/libata.h
index 2e098f9..ce7603a 100644
--- a/include/linux/libata.h
+++ b/include/linux/libata.h
@@ -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;
}