lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Thu,  2 Feb 2017 14:55:49 +0200
From:   Gilad Ben-Yossef <gilad@...yossef.com>
To:     linux-kernel@...r.kernel.org
Cc:     gilad.benyossef@....com, ofir.drang@....com
Subject: [PATCH 1/2] scatterlist: reorder compound boolean expression

Test the cheaper boolean expression with no side effects first.

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

Powered by blists - more mailing lists