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>] [day] [month] [year] [list]
Message-ID: <alpine.DEB.0.83.0703260952560.20524@sigma.j-a-k-j.com>
Date:	Mon, 26 Mar 2007 10:22:13 -0400 (EDT)
From:	"John Anthony Kazos Jr." <jakj@...-k-j.com>
To:	axboe@...nel.dk
cc:	linux-kernel@...r.kernel.org
Subject: [PATCH] fs/buffer.c: Loop rewrite within grow_buffers for finding
 sizebits

From: John Anthony Kazos Jr. <jakj@...-k-j.com>

This patch alters the (do...while) construct to a simple (while) and saves 
one increment operation. It's entirely possible that gcc optimizes away 
the first iteration anyway, but in case it doesn't (and also because it's 
easier to read this way), I think this is better.

Signed-off-by: John Anthony Kazos Jr. <jakj@...-k-j.com>

---

--- linux-2.6.20.4/fs/buffer.c.orig	2007-03-26 09:42:15.000000000 -0400
+++ linux-2.6.20.4/fs/buffer.c	2007-03-26 10:10:25.000000000 -0400
@@ -1045,10 +1045,10 @@ grow_buffers(struct block_device *bdev,
  	pgoff_t index;
  	int sizebits;

-	sizebits = -1;
-	do {
+	sizebits = 0;
+	while ((size << sizebits) < PAGE_SIZE) {
  		sizebits++;
-	} while ((size << sizebits) < PAGE_SIZE);
+	}

  	index = block >> sizebits;

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ