summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorGilad Ben-Yossef <gilad@benyossef.com>2017-02-08 10:28:25 +1100
committerStephen Rothwell <sfr@canb.auug.org.au>2017-02-09 21:53:11 +1100
commit8b8ec1a44e045513b49c35e571567b7b787b0ad4 (patch)
tree54ada8775b240a260832db6585b02de6b192ff36 /lib
parente1d35d4dc7f089e6c9c080d556feedf9c706f0c7 (diff)
scatterlist: reorder compound boolean expression
Test the cheaper boolean expression with no side effects first. Link: http://lkml.kernel.org/r/1486040150-14109-2-git-send-email-gilad@benyossef.com Signed-off-by: Gilad Ben-Yossef <gilad@benyossef.com> Cc: Jens Axboe <axboe@kernel.dk> Cc: <ofir.drang@arm.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Diffstat (limited to 'lib')
-rw-r--r--lib/scatterlist.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/scatterlist.c b/lib/scatterlist.c
index 539dd344f1c5..cc4d1a2d6bf3 100644
--- a/lib/scatterlist.c
+++ b/lib/scatterlist.c
@@ -680,7 +680,7 @@ size_t sg_copy_buffer(struct scatterlist *sgl, unsigned int nents, void *buf,
local_irq_save(flags);
- while (sg_miter_next(&miter) && offset < buflen) {
+ while ((offset < buflen) && sg_miter_next(&miter)) {
unsigned int len;
len = min(miter.length, buflen - offset);