Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1572331 > unrolled thread

[PATCH 1/2] scatterlist: reorder compound boolean expression

Started byGilad Ben-Yossef <gilad@benyossef.com>
First post2017-02-02 14:00 +0100
Last post2017-02-02 14:00 +0100
Articles 1 — 1 participant

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  [PATCH 1/2] scatterlist: reorder compound boolean expression Gilad Ben-Yossef <gilad@benyossef.com> - 2017-02-02 14:00 +0100

#1572331 — [PATCH 1/2] scatterlist: reorder compound boolean expression

FromGilad Ben-Yossef <gilad@benyossef.com>
Date2017-02-02 14:00 +0100
Subject[PATCH 1/2] scatterlist: reorder compound boolean expression
Message-ID<t6p9v-441-3@gated-at.bofh.it>
Test the cheaper boolean expression with no side effects first.

Signed-off-by: Gilad Ben-Yossef <gilad@benyossef.com>
---
 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

[toc] | [standalone]


Back to top | Article view | linux.kernel


csiph-web