Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932771AbbFHX1p (ORCPT ); Mon, 8 Jun 2015 19:27:45 -0400 Received: from mail-lb0-f181.google.com ([209.85.217.181]:35402 "EHLO mail-lb0-f181.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932657AbbFHX1Y (ORCPT ); Mon, 8 Jun 2015 19:27:24 -0400 From: Rasmus Villemoes To: Andrew Morton , "Theodore Ts'o" , Andreas Dilger Cc: Joe Perches , Al Viro , Rasmus Villemoes , linux-ext4@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 8/8] fs/ext4/super.c: Use strreplace in ext4_fill_super Date: Tue, 9 Jun 2015 01:26:56 +0200 Message-Id: <1433806017-10823-9-git-send-email-linux@rasmusvillemoes.dk> X-Mailer: git-send-email 2.1.3 In-Reply-To: <1433806017-10823-1-git-send-email-linux@rasmusvillemoes.dk> References: <1433806017-10823-1-git-send-email-linux@rasmusvillemoes.dk> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1145 Lines: 39 This makes a very large function a little smaller. Signed-off-by: Rasmus Villemoes --- v2: no changes. fs/ext4/super.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/fs/ext4/super.c b/fs/ext4/super.c index ca9d4a2fed41..5f3c43a66937 100644 --- a/fs/ext4/super.c +++ b/fs/ext4/super.c @@ -3420,7 +3420,6 @@ static int ext4_fill_super(struct super_block *sb, void *data, int silent) unsigned long journal_devnum = 0; unsigned long def_mount_opts; struct inode *root; - char *cp; const char *descr; int ret = -ENOMEM; int blocksize, clustersize; @@ -3456,8 +3455,7 @@ static int ext4_fill_super(struct super_block *sb, void *data, int silent) #endif /* Cleanup superblock name */ - for (cp = sb->s_id; (cp = strchr(cp, '/'));) - *cp = '!'; + strreplace(sb->s_id, '/', '!'); /* -EINVAL is default */ ret = -EINVAL; -- 2.1.3 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/