projects
/
platform
/
kernel
/
linux-rpi.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
95e91b8
)
scatterlist: reorder compound boolean expression
author
Gilad Ben-Yossef
<gilad@benyossef.com>
Mon, 27 Feb 2017 22:28:27 +0000
(14:28 -0800)
committer
Linus Torvalds
<torvalds@linux-foundation.org>
Tue, 28 Feb 2017 02:43:46 +0000
(18:43 -0800)
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>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
lib/scatterlist.c
patch
|
blob
|
history
diff --git
a/lib/scatterlist.c
b/lib/scatterlist.c
index
004fc70
..
393920f
100644
(file)
--- 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);