Skip to content

Commit

Permalink
sg_last() should use unsigned loop index variable
Browse files Browse the repository at this point in the history
Clean up: fix a mixed sign comparison in sg_last() accidentally
introduced by commit 70eb804.  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>
  • Loading branch information
Chuck Lever authored and Jens Axboe committed Oct 29, 2007
1 parent 30fa0d0 commit 74eb94f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion include/linux/scatterlist.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 74eb94f

Please sign in to comment.