linux-ext4.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Simon Xu <xu.simon@oracle.com>
To: jack@suse.cz
Cc: linux-ext4@vger.kernel.org, linux-kernel@vger.kernel.org,
	Simon Xu <xu.simon@oracle.com>
Subject: [PATCH] ext2: reduce redundant check of '*options'
Date: Thu, 13 Jan 2011 20:39:22 +0800	[thread overview]
Message-ID: <1294922362-2237-1-git-send-email-xu.simon@oracle.com> (raw)

We don't need to check whether '*options' equals to ',' twice.

Signed-off-by: Simon Xu <xu.simon@oracle.com>
---
 fs/ext2/super.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/fs/ext2/super.c b/fs/ext2/super.c
index 7731695..bd5b66b 100644
--- a/fs/ext2/super.c
+++ b/fs/ext2/super.c
@@ -377,13 +377,13 @@ static unsigned long get_sb_block(void **data)
 		return 1;	/* Default location */
 	options += 3;
 	sb_block = simple_strtoul(options, &options, 0);
-	if (*options && *options != ',') {
+	if (*options == ',') {
+		options++;
+	} else if (*options) {
 		printk("EXT2-fs: Invalid sb specification: %s\n",
 		       (char *) *data);
 		return 1;
 	}
-	if (*options == ',')
-		options++;
 	*data = (void *) options;
 	return sb_block;
 }
-- 
1.7.3.5


             reply	other threads:[~2011-01-13 12:41 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-01-13 12:39 Simon Xu [this message]
2011-01-17 17:02 ` [PATCH] ext2: reduce redundant check of '*options' Jan Kara
2011-01-18 13:43   ` Ted Ts'o
2011-01-18 22:24     ` Jan Kara

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=1294922362-2237-1-git-send-email-xu.simon@oracle.com \
    --to=xu.simon@oracle.com \
    --cc=jack@suse.cz \
    --cc=linux-ext4@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    /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;
as well as URLs for NNTP newsgroup(s).