]> err.no Git - linux-2.6/commitdiff
sg_last() should use unsigned loop index variable
authorChuck Lever <chuck.lever@oracle.com>
Fri, 26 Oct 2007 17:29:47 +0000 (19:29 +0200)
committerJens Axboe <jens.axboe@oracle.com>
Mon, 29 Oct 2007 08:18:04 +0000 (09:18 +0100)
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 <chuck.lever@oracle.com>
Signed-off-by: Jens Axboe <axboe@carl.home.kernel.dk>
include/linux/scatterlist.h

index b2ec8421b89f00b7fe20a872462210b1b2c1ca8e..19b751aabd1684b9250a9cb2e4a5e489ac2f8ca4 100644 (file)
@@ -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;