mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Rakib Mullick" <rakib.mullick@gmail.com>
To: "Linux-kernel Mailing List" <linux-kernel@vger.kernel.org>
Cc: mingo@elte.hu, akpm@linux-foundation.org
Subject: [PATCH] init: Reduce text space by removing a variable.
Date: Mon, 12 Jan 2009 11:57:39 +0600	[thread overview]
Message-ID: <b9df5fa10901112157j449d104fm1a1281a6bef409f9@mail.gmail.com> (raw)

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@gmail.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;

             reply	other threads:[~2009-01-12  5:57 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-01-12  5:57 Rakib Mullick [this message]
2009-01-12  6:43 ` Sergio Luis

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=b9df5fa10901112157j449d104fm1a1281a6bef409f9@mail.gmail.com \
    --to=rakib.mullick@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®