linux-ext4.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ext2: reduce redundant check of '*options'
@ 2011-01-13 12:39 Simon Xu
  2011-01-17 17:02 ` Jan Kara
  0 siblings, 1 reply; 4+ messages in thread
From: Simon Xu @ 2011-01-13 12:39 UTC (permalink / raw)
  To: jack; +Cc: linux-ext4, linux-kernel, Simon Xu

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


^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2011-01-18 22:24 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-01-13 12:39 [PATCH] ext2: reduce redundant check of '*options' Simon Xu
2011-01-17 17:02 ` Jan Kara
2011-01-18 13:43   ` Ted Ts'o
2011-01-18 22:24     ` Jan Kara

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).