projects
/
GitHub
/
exynos8895
/
android_kernel_samsung_universal8895.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
2e48461
)
scatterlist: refactor the sg_nents
author
Maxim Levitsky
<maximlevitsky@gmail.com>
Fri, 28 Sep 2012 08:38:15 +0000
(10:38 +0200)
committer
Jens Axboe
<axboe@kernel.dk>
Fri, 28 Sep 2012 08:38:15 +0000
(10:38 +0200)
Replace 'while' with 'for' as suggested by Tejun Heo
Signed-off-by: Maxim Levitsky <maximlevitsky@gmail.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
lib/scatterlist.c
patch
|
blob
|
blame
|
history
diff --git
a/lib/scatterlist.c
b/lib/scatterlist.c
index 1bf60efb5e02424368d0847af2894f900a3ad5d2..8cd2ced68f36f3d2c37fad2fba75904374145297 100644
(file)
--- a/
lib/scatterlist.c
+++ b/
lib/scatterlist.c
@@
-49,12
+49,9
@@
EXPORT_SYMBOL(sg_next);
**/
int sg_nents(struct scatterlist *sg)
{
- int nents
= 0
;
- while (sg) {
+ int nents;
+ for (nents = 0; sg; sg = sg_next(sg))
nents++;
- sg = sg_next(sg);
- }
-
return nents;
}
EXPORT_SYMBOL(sg_nents);