[PATCH 1/2] scatterlist: reorder compound boolean expression
From: Gilad Ben-Yossef
Date: Thu Feb 02 2017 - 07:56:06 EST
Test the cheaper boolean expression with no side effects first.
Signed-off-by: Gilad Ben-Yossef <gilad@xxxxxxxxxxxxx>
---
lib/scatterlist.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lib/scatterlist.c b/lib/scatterlist.c
index 004fc70..393920f 100644
--- a/lib/scatterlist.c
+++ b/lib/scatterlist.c
@@ -666,7 +666,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);
--
2.1.4