From 74eb94f7b84f4e631a0e020991fb16f17ce85ab7 Mon Sep 17 00:00:00 2001 From: Chuck Lever Date: Fri, 26 Oct 2007 19:29:47 +0200 Subject: [PATCH] sg_last() should use unsigned loop index variable Clean up: fix a mixed sign comparison in sg_last() accidentally introduced by commit 70eb8040. The sign of the loop index variable should match the sign of the "nents" argument. Signed-off-by: Chuck Lever Signed-off-by: Jens Axboe --- include/linux/scatterlist.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/linux/scatterlist.h b/include/linux/scatterlist.h index b2ec8421b8..19b751aabd 100644 --- a/include/linux/scatterlist.h +++ b/include/linux/scatterlist.h @@ -150,7 +150,7 @@ static inline struct scatterlist *sg_last(struct scatterlist *sgl, struct scatterlist *ret = &sgl[nents - 1]; #else struct scatterlist *sg, *ret = NULL; - int i; + unsigned int i; for_each_sg(sgl, sg, nents, i) ret = sg; -- 2.39.5