All of lore.kernel.org
 help / color / mirror / Atom feed
From: Peter Osterlund <petero2@telia.com>
To: Linus Torvalds <torvalds@osdl.org>
Cc: "Paolo 'Blaisorblade' Giarrusso" <blaisorblade@yahoo.it>,
	Andrew Morton <akpm@osdl.org>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] Fix ext3 warning for unused var
Date: 28 Oct 2005 20:23:39 +0200	[thread overview]
Message-ID: <m3acgto5zo.fsf@telia.com> (raw)
In-Reply-To: <Pine.LNX.4.64.0510091314200.31407@g5.osdl.org>

Linus Torvalds <torvalds@osdl.org> writes:

> On Sun, 9 Oct 2005, Paolo 'Blaisorblade' Giarrusso wrote:
> >
> > Can please someone merge this? It's the 3rd time I send it.
> 
> I don't like #ifdef's in code. 
> 
> You could just have split up the quota-specific stuff into a function of 
> their own: "ext3_show_quota_options()". The patch might have been larger, 
> but it would actually clean up the code rather than make it uglier.
> 
> Warnings are not a reason for ugly code.

Fix compile warning in ext3 quota code.

Signed-off-by: Peter Osterlund <petero2@telia.com>
---

 fs/ext3/super.c |   26 ++++++++++++++++----------
 1 files changed, 16 insertions(+), 10 deletions(-)

diff --git a/fs/ext3/super.c b/fs/ext3/super.c
index 9e24ceb..097383c 100644
--- a/fs/ext3/super.c
+++ b/fs/ext3/super.c
@@ -510,19 +510,11 @@ static void ext3_clear_inode(struct inod
 	kfree(rsv);
 }
 
-static int ext3_show_options(struct seq_file *seq, struct vfsmount *vfs)
+static inline void ext3_show_quota_options(struct seq_file *seq, struct super_block *sb)
 {
-	struct super_block *sb = vfs->mnt_sb;
+#if defined(CONFIG_QUOTA)
 	struct ext3_sb_info *sbi = EXT3_SB(sb);
 
-	if (test_opt(sb, DATA_FLAGS) == EXT3_MOUNT_JOURNAL_DATA)
-		seq_puts(seq, ",data=journal");
-	else if (test_opt(sb, DATA_FLAGS) == EXT3_MOUNT_ORDERED_DATA)
-		seq_puts(seq, ",data=ordered");
-	else if (test_opt(sb, DATA_FLAGS) == EXT3_MOUNT_WRITEBACK_DATA)
-		seq_puts(seq, ",data=writeback");
-
-#if defined(CONFIG_QUOTA)
 	if (sbi->s_jquota_fmt)
 		seq_printf(seq, ",jqfmt=%s",
 		(sbi->s_jquota_fmt == QFMT_VFS_OLD) ? "vfsold": "vfsv0");
@@ -539,6 +531,20 @@ static int ext3_show_options(struct seq_
 	if (sbi->s_mount_opt & EXT3_MOUNT_GRPQUOTA)
 		seq_puts(seq, ",grpquota");
 #endif
+}
+
+static int ext3_show_options(struct seq_file *seq, struct vfsmount *vfs)
+{
+	struct super_block *sb = vfs->mnt_sb;
+
+	if (test_opt(sb, DATA_FLAGS) == EXT3_MOUNT_JOURNAL_DATA)
+		seq_puts(seq, ",data=journal");
+	else if (test_opt(sb, DATA_FLAGS) == EXT3_MOUNT_ORDERED_DATA)
+		seq_puts(seq, ",data=ordered");
+	else if (test_opt(sb, DATA_FLAGS) == EXT3_MOUNT_WRITEBACK_DATA)
+		seq_puts(seq, ",data=writeback");
+
+	ext3_show_quota_options(seq, sb);
 
 	return 0;
 }

-- 
Peter Osterlund - petero2@telia.com
http://web.telia.com/~u89404340

  parent reply	other threads:[~2005-10-28 18:23 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-10-09 19:58 [PATCH] Fix ext3 warning for unused var Paolo 'Blaisorblade' Giarrusso
2005-10-09 20:16 ` Linus Torvalds
2005-10-09 19:53   ` jmerkey
2005-10-09 21:29     ` Al Viro
2005-10-09 20:18       ` jmerkey
2005-10-09 22:08         ` Al Viro
2005-10-09 22:13           ` jmerkey
2005-10-09 23:47             ` Al Viro
2005-10-09 23:55             ` Valdis.Kletnieks
2005-10-10  1:43             ` Gene Heskett
2005-10-09 23:58           ` Valdis.Kletnieks
2005-10-09 22:47             ` jmerkey
2005-10-10 11:02               ` Andi Kleen
2005-10-28 18:23   ` Peter Osterlund [this message]
  -- strict thread matches above, loose matches on Subject: below --
2005-10-06 15:35 Paolo 'Blaisorblade' Giarrusso
2005-09-29 18:40 Paolo 'Blaisorblade' Giarrusso

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=m3acgto5zo.fsf@telia.com \
    --to=petero2@telia.com \
    --cc=akpm@osdl.org \
    --cc=blaisorblade@yahoo.it \
    --cc=linux-kernel@vger.kernel.org \
    --cc=torvalds@osdl.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.