mirror of
https://github.com/raspberrypi/linux.git
synced 2025-12-06 01:49:46 +00:00
scatterlist: refactor the sg_nents
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>
This commit is contained in:
committed by
Jens Axboe
parent
2e48461029
commit
232f1b5106
@@ -49,12 +49,9 @@ EXPORT_SYMBOL(sg_next);
|
|||||||
**/
|
**/
|
||||||
int sg_nents(struct scatterlist *sg)
|
int sg_nents(struct scatterlist *sg)
|
||||||
{
|
{
|
||||||
int nents = 0;
|
int nents;
|
||||||
while (sg) {
|
for (nents = 0; sg; sg = sg_next(sg))
|
||||||
nents++;
|
nents++;
|
||||||
sg = sg_next(sg);
|
|
||||||
}
|
|
||||||
|
|
||||||
return nents;
|
return nents;
|
||||||
}
|
}
|
||||||
EXPORT_SYMBOL(sg_nents);
|
EXPORT_SYMBOL(sg_nents);
|
||||||
|
|||||||
Reference in New Issue
Block a user