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-next>] [day] [month] [year] [list]
Message-Id: <1424112583-116849-1-git-send-email-aksgarg1989@gmail.com>
Date:	Mon, 16 Feb 2015 10:49:43 -0800
From:	Anshul Garg <aksgarg1989@...il.com>
To:	linux-kernel@...r.kernel.org
Cc:	aksgarg1989@...il.com, anshul.g@...sung.com,
	torvalds@...ux-foundation.org
Subject: [PATCH] lib/vsprintf.c:Avoid extra operation in dentry_name

From: Anshul Garg <aksgarg1989@...il.com>

Remove unnecessary increment and decrement operation
in dentry_name function as after increment operation
loop is breaked and then decrement operation is
performed. So remove increment and decrement operation
from the function.

Signed-off-by: Anshul Garg <aksgarg1989@...il.com>
---
 lib/vsprintf.c |    3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/lib/vsprintf.c b/lib/vsprintf.c
index ec337f6..2a38105 100644
--- a/lib/vsprintf.c
+++ b/lib/vsprintf.c
@@ -576,11 +576,10 @@ char *dentry_name(char *buf, char *end, const struct dentry *d, struct printf_sp
 		if (p == d) {
 			if (i)
 				array[i] = "";
-			i++;
 			break;
 		}
 	}
-	s = array[--i];
+	s = array[i];
 	for (n = 0; n != spec.precision; n++, buf++) {
 		char c = *s++;
 		if (!c) {
-- 
1.7.9.5


---
This email has been checked for viruses by Avast antivirus software.
http://www.avast.com

--
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