Skip to content

Commit

Permalink
scatterlist: reorder compound boolean expression
Browse files Browse the repository at this point in the history
Test the cheaper boolean expression with no side effects first.

Link: http://lkml.kernel.org/r/[email protected]
Signed-off-by: Gilad Ben-Yossef <[email protected]>
Cc: Jens Axboe <[email protected]>
Cc: <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
gby authored and torvalds committed Feb 28, 2017
1 parent 95e91b8 commit 1d5210e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/scatterlist.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 1d5210e

Please sign in to comment.