Patchwork ext4: reduce redundant check of '*options'

login
register
mail settings
Submitter Simon Xu
Date Jan. 13, 2011, 12:45 p.m.
Message ID <1294922732-2385-1-git-send-email-xu.simon@oracle.com>
Download mbox | patch
Permalink /patch/78746/
State New
Headers show

Comments

Simon Xu - Jan. 13, 2011, 12:45 p.m.
We don't need to check whether '*options' equals to ',' twice.

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

Patch

diff --git a/fs/ext4/super.c b/fs/ext4/super.c
index 29c80f6..5d8c173 100644
--- a/fs/ext4/super.c
+++ b/fs/ext4/super.c
@@ -1350,13 +1350,13 @@  static ext4_fsblk_t get_sb_block(void **data)
 	options += 3;
 	/* TODO: use simple_strtoll with >32bit ext4 */
 	sb_block = simple_strtoul(options, &options, 0);
-	if (*options && *options != ',') {
+	if (*options == ',') {
+		options++;
+	else if (*options) {
 		printk(KERN_ERR "EXT4-fs: Invalid sb specification: %s\n",
 		       (char *) *data);
 		return 1;
 	}
-	if (*options == ',')
-		options++;
 	*data = (void *) options;
 
 	return sb_block;