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 for Android: free password hash cracker in your pocket
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <b9df5fa10901112157j449d104fm1a1281a6bef409f9@mail.gmail.com>
Date:	Mon, 12 Jan 2009 11:57:39 +0600
From:	"Rakib Mullick" <rakib.mullick@...il.com>
To:	"Linux-kernel Mailing List" <linux-kernel@...r.kernel.org>
Cc:	mingo@...e.hu, akpm@...ux-foundation.org
Subject: [PATCH] init: Reduce text space by removing a variable.

Impact: Reduce some text space.

We can carryout the function 'raid_setup' without the variable 'len'
and using a bit compiler optimization. Which also removes 8 bytes of
text space on my x86 system.

Signed-off-by: Rakib Mullick <rakib.mullick@...il.com>

--- linux-2.6-orig/init/do_mounts_md.c	2009-01-12 09:53:09.000000000 +0600
+++ linux-2.6/init/do_mounts_md.c	2009-01-12 11:12:39.734543784 +0600
@@ -243,17 +243,17 @@ static void __init md_setup_drive(void)

 static int __init raid_setup(char *str)
 {
-	int len, pos;
+	int pos;

-	len = strlen(str) + 1;
 	pos = 0;

-	while (pos < len) {
+	while (pos < strlen(str) + 1) {
 		char *comma = strchr(str+pos, ',');
 		int wlen;
 		if (comma)
 			wlen = (comma-str)-pos;
-		else	wlen = (len-1)-pos;
+		else	
+			wlen = strlen(str)-pos;

 		if (!strncmp(str, "noautodetect", wlen))
 			raid_noautodetect = 1;
--
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