diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/scatterlist.c | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/lib/scatterlist.c b/lib/scatterlist.c index 1bf60efb5e02..8cd2ced68f36 100644 --- a/lib/scatterlist.c +++ b/lib/scatterlist.c | |||
@@ -49,12 +49,9 @@ EXPORT_SYMBOL(sg_next); | |||
49 | **/ | 49 | **/ |
50 | int sg_nents(struct scatterlist *sg) | 50 | int sg_nents(struct scatterlist *sg) |
51 | { | 51 | { |
52 | int nents = 0; | 52 | int nents; |
53 | while (sg) { | 53 | for (nents = 0; sg; sg = sg_next(sg)) |
54 | nents++; | 54 | nents++; |
55 | sg = sg_next(sg); | ||
56 | } | ||
57 | |||
58 | return nents; | 55 | return nents; |
59 | } | 56 | } |
60 | EXPORT_SYMBOL(sg_nents); | 57 | EXPORT_SYMBOL(sg_nents); |