public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH][2.6.14-rc2] ext3: fix build warning if !quota
@ 2005-09-29  1:46 pinotj
  2005-09-29  1:57 ` Al Viro
  0 siblings, 1 reply; 5+ messages in thread
From: pinotj @ 2005-09-29  1:46 UTC (permalink / raw)
  To: linux-kernel

Hi,

(My first e-mail seems to be lost somewhere, here is a second try)

sbi is not used if quota is not defined. This leads to a useless
variable after preprocessing and a build warning.

This moves the declaration in right place.

 ------8<------
diff -Naur a/fs/ext3/super.c b/fs/ext3/super.c
--- a/fs/ext3/super.c	2005-09-29 00:28:16.000000000 +0000
+++ b/fs/ext3/super.c	2005-09-29 00:25:02.000000000 +0000
@@ -513,7 +513,6 @@
 static int ext3_show_options(struct seq_file *seq, struct vfsmount *vfs)
 {
 	struct super_block *sb = vfs->mnt_sb;
-	struct ext3_sb_info *sbi = EXT3_SB(sb);

 	if (test_opt(sb, DATA_FLAGS) == EXT3_MOUNT_JOURNAL_DATA)
 		seq_puts(seq, ",data=journal");
@@ -523,6 +522,8 @@
 		seq_puts(seq, ",data=writeback");

 #if defined(CONFIG_QUOTA)
+	struct ext3_sb_info *sbi = EXT3_SB(sb);
+
 	if (sbi->s_jquota_fmt)
 		seq_printf(seq, ",jqfmt=%s",
 		(sbi->s_jquota_fmt == QFMT_VFS_OLD) ? "vfsold": "vfsv0");
 ------8<------

Signed-off-by: Jerome Pinot <ngc891@gmail.com>


Regards,

--
Jerome Pinot
http://ngc891.blogdns.net/


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

* Re: [PATCH][2.6.14-rc2] ext3: fix build warning if !quota
  2005-09-29  1:46 [PATCH][2.6.14-rc2] ext3: fix build warning if !quota pinotj
@ 2005-09-29  1:57 ` Al Viro
  0 siblings, 0 replies; 5+ messages in thread
From: Al Viro @ 2005-09-29  1:57 UTC (permalink / raw)
  To: pinotj; +Cc: linux-kernel

On Thu, Sep 29, 2005 at 03:46:53AM +0200, pinotj@club-internet.fr wrote:
> Hi,
> 
> (My first e-mail seems to be lost somewhere, here is a second try)
> 
> sbi is not used if quota is not defined. This leads to a useless
> variable after preprocessing and a build warning.
> 
> This moves the declaration in right place.

... and puts declaration in the middle of code.

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

* Re: [PATCH][2.6.14-rc2] ext3: fix build warning if !quota
@ 2005-09-29  2:24 pinotj
  2005-09-29 10:10 ` Jan Kara
  0 siblings, 1 reply; 5+ messages in thread
From: pinotj @ 2005-09-29  2:24 UTC (permalink / raw)
  To: viro; +Cc: linux-kernel


>Date: Thu, 29 Sep 2005 02:57:20 +0100
>From: Al Viro
>To: pinotj
>Cc: linux-kernel
>Subject: Re: [PATCH][2.6.14-rc2] ext3: fix build warning if !quota
[...]
>.... and puts declaration in the middle of code.
>

Is this better ?

------8<------
diff -Naur a/fs/ext3/super.c b/fs/ext3/super.c
--- a/fs/ext3/super.c	2005-09-29 00:28:16.000000000 +0000
+++ b/fs/ext3/super.c	2005-09-29 02:18:22.000000000 +0000
@@ -513,7 +513,9 @@
 static int ext3_show_options(struct seq_file *seq, struct vfsmount *vfs)
 {
 	struct super_block *sb = vfs->mnt_sb;
+#if defined(CONFIG_QUOTA)
 	struct ext3_sb_info *sbi = EXT3_SB(sb);
+#endif
 
 	if (test_opt(sb, DATA_FLAGS) == EXT3_MOUNT_JOURNAL_DATA)
 		seq_puts(seq, ",data=journal");
------8<------


-- 
Jerome Pinot
http://ngc891.blogdns.net/


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

* Re: [PATCH][2.6.14-rc2] ext3: fix build warning if !quota
  2005-09-29  2:24 pinotj
@ 2005-09-29 10:10 ` Jan Kara
  0 siblings, 0 replies; 5+ messages in thread
From: Jan Kara @ 2005-09-29 10:10 UTC (permalink / raw)
  To: pinotj; +Cc: linux-kernel

> 
> >Date: Thu, 29 Sep 2005 02:57:20 +0100
> >From: Al Viro
> >To: pinotj
> >Cc: linux-kernel
> >Subject: Re: [PATCH][2.6.14-rc2] ext3: fix build warning if !quota
> [...]
> >.... and puts declaration in the middle of code.
> >
> 
> Is this better ?
  Yes, I like this version better. I guess you can submit it to Andrew.
(and add your Signed-off-by before the patch (Andrew's scripts won't find 
it otherwise I guess. Feel free to add mine too).

								Honza

> ------8<------
> diff -Naur a/fs/ext3/super.c b/fs/ext3/super.c
> --- a/fs/ext3/super.c	2005-09-29 00:28:16.000000000 +0000
> +++ b/fs/ext3/super.c	2005-09-29 02:18:22.000000000 +0000
> @@ -513,7 +513,9 @@
>  static int ext3_show_options(struct seq_file *seq, struct vfsmount *vfs)
>  {
>  	struct super_block *sb = vfs->mnt_sb;
> +#if defined(CONFIG_QUOTA)
>  	struct ext3_sb_info *sbi = EXT3_SB(sb);
> +#endif
>  
>  	if (test_opt(sb, DATA_FLAGS) == EXT3_MOUNT_JOURNAL_DATA)
>  		seq_puts(seq, ",data=journal");
> ------8<------
> 
> 
> -- 
> Jerome Pinot
> http://ngc891.blogdns.net/
> 
> -
> 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/

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

* Re: [PATCH][2.6.14-rc2] ext3: fix build warning if !quota
       [not found] <88ee31b7050928174557572f77@mail.gmail.com>
@ 2005-09-29 16:45 ` OGAWA Hirofumi
  0 siblings, 0 replies; 5+ messages in thread
From: OGAWA Hirofumi @ 2005-09-29 16:45 UTC (permalink / raw)
  To: Jerome Pinot; +Cc: linux-kernel

Jerome Pinot <ngc891@gmail.com> writes:

> sbi is not used if quota is not defined. This leads to a useless
> variable after preprocessing and a build warning.
>
> This moves the declaration in right place.

Sorry, my fault. But we use -Wdeclaration-after-statement option.
So, gcc-4.0.1 warns it, and gcc info says "not supported before GCC 3.0".

fs/ext3/super.c: In function 'ext3_show_options':
fs/ext3/super.c:525: warning: ISO C90 forbids mixed declarations and code

How about this instead?

Thanks.
-- 
OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>

Signed-off-by: OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>
---

 fs/ext3/super.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff -puN fs/ext3/super.c~aaa fs/ext3/super.c
--- linux-2.6.14-rc2-a/fs/ext3/super.c~aaa	2005-09-30 01:10:55.000000000 +0900
+++ linux-2.6.14-rc2-a-hirofumi/fs/ext3/super.c	2005-09-30 01:10:55.000000000 +0900
@@ -513,8 +513,9 @@ static void ext3_clear_inode(struct inod
 static int ext3_show_options(struct seq_file *seq, struct vfsmount *vfs)
 {
 	struct super_block *sb = vfs->mnt_sb;
+#if defined(CONFIG_QUOTA)
 	struct ext3_sb_info *sbi = EXT3_SB(sb);
-
+#endif
 	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)
_

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

end of thread, other threads:[~2005-09-29 16:45 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-09-29  1:46 [PATCH][2.6.14-rc2] ext3: fix build warning if !quota pinotj
2005-09-29  1:57 ` Al Viro
  -- strict thread matches above, loose matches on Subject: below --
2005-09-29  2:24 pinotj
2005-09-29 10:10 ` Jan Kara
     [not found] <88ee31b7050928174557572f77@mail.gmail.com>
2005-09-29 16:45 ` OGAWA Hirofumi

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox