Skip to contentSkip to conversation

ext4: reduce redundant check of '*options'

PATCH New Simon Xu 1 participant 1 message Jan 13, 2011 ext4 file system

lore
Share & tools
lore

Simon Xu

author
#0 lore raw

PATCH 1/1 ext4: reduce redundant check of '*options'

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

---
 fs/ext4/super.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)
fs/ext4/super.c +3 -3
index 29c80f6..5d8c173 100644
@@ -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;
Signature · 1 line
1.7.3.5