Skip to contentSkip to conversation

ext4: Fix compile warnings with EXT4FS_DEBUG

PATCH In review Akira Fujita 2 participants 3 messages Jan 21, 2011 – Feb 22, 2011 ext4 file system

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ext4: Fix compile warnings with EXT4FS_DEBUG

Compile 2.6.38-rc1 with turning EXT4FS_DEBUG on, we get following compile warnings. This patch fixes them.

CC fs/ext4/hash.o
CC fs/ext4/resize.o
fs/ext4/resize.c: In function 'setup_new_group_blocks':
fs/ext4/resize.c:233:2: warning: format '%#04llx' expects type 'long long unsigned int', but argument 3 has type 'long unsigned int' fs/ext4/resize.c:251:2: warning: format '%#04llx' expects type 'long long unsigned int', but argument 3 has type 'long unsigned int'

  CC      fs/ext4/extents.o
  CC      fs/ext4/ext4_jbd2.o
  CC      fs/ext4/migrate.o
---
 fs/ext4/resize.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
fs/ext4/resize.c 2011-01-21 14:08:49.000000000 +0900 renamed from fs/ext4/resize.c 2011-01-21 14:07:55.000000000 +0900 +2 -2
diff -Nrup -X linux-2.6.38-rc1-a/Documentation/dontdiff linux-2.6.38-rc1-a/fs/ext4/resize.c linux-2.6.38-rc1-b/fs/ext4/resize.c
@@ -231,7 +231,7 @@ static int setup_new_group_blocks(struct
 
        /* Zero out all of the reserved backup group descriptor table blocks */
        ext4_debug("clear inode table blocks %#04llx -> %#04llx\n",
-                       block, sbi->s_itb_per_group);
+                       block, (ext4_fsblk_t)sbi->s_itb_per_group);
        err = sb_issue_zeroout(sb, gdblocks + start + 1, reserved_gdb,
                               GFP_NOFS);
        if (err)
@@ -249,7 +249,7 @@ static int setup_new_group_blocks(struct
        /* Zero out all of the inode table blocks */
        block = input->inode_table;
        ext4_debug("clear inode table blocks %#04llx -> %#04llx\n",
-                       block, sbi->s_itb_per_group);
+                       block, (ext4_fsblk_t)sbi->s_itb_per_group);
        err = sb_issue_zeroout(sb, block, sbi->s_itb_per_group, GFP_NOFS);
        if (err)
                goto exit_bh;
maintainer
#1 lore raw

Review

Quoted 3 lines · Akira Fujita
        ext4_debug("clear inode table blocks %#04llx -> %#04llx\n",
(quoted diff) +1 -1
-                       block, sbi->s_itb_per_group);
+                       block, (ext4_fsblk_t)sbi->s_itb_per_group);

s_itb_per_group is defined to be an unsigned long, so a much better fix is simply to change the format string.

- Ted

Quoted 1 line

From da488945f4bf4096f4ab6091938469bd8822cfec Mon Sep 17 00:00:00 2001

From: Theodore Ts'o <[email protected]>
Date: Mon, 21 Feb 2011 20:39:58 -0500
Subject: [PATCH] ext4: fix compile warnings with EXT4FS_DEBUG enabled

Compile 2.6.38-rc1 with turning EXT4FS_DEBUG on, we get following compile warnings. This patch fixes them.

CC fs/ext4/hash.o
CC fs/ext4/resize.o
fs/ext4/resize.c: In function 'setup_new_group_blocks':
fs/ext4/resize.c:233:2: warning: format '%#04llx' expects type 'long long unsigned int', but argument 3 has type 'long unsigned int' fs/ext4/resize.c:251:2: warning: format '%#04llx' expects type 'long long unsigned int', but argument 3 has type 'long unsigned int'

  CC      fs/ext4/extents.o
  CC      fs/ext4/ext4_jbd2.o
  CC      fs/ext4/migrate.o
---
 fs/ext4/resize.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
fs/ext4/resize.c +2 -2
index 3ecc6e4..66fec4e 100644
@@ -230,7 +230,7 @@ static int setup_new_group_blocks(struct super_block *sb,
 	}
 
 	/* Zero out all of the reserved backup group descriptor table blocks */
-	ext4_debug("clear inode table blocks %#04llx -> %#04llx\n",
+	ext4_debug("clear inode table blocks %#04llx -> %#04lx\n",
 			block, sbi->s_itb_per_group);
 	err = sb_issue_zeroout(sb, gdblocks + start + 1, reserved_gdb,
 			       GFP_NOFS);
@@ -248,7 +248,7 @@ static int setup_new_group_blocks(struct super_block *sb,
 
 	/* Zero out all of the inode table blocks */
 	block = input->inode_table;
-	ext4_debug("clear inode table blocks %#04llx -> %#04llx\n",
+	ext4_debug("clear inode table blocks %#04llx -> %#04lx\n",
 			block, sbi->s_itb_per_group);
 	err = sb_issue_zeroout(sb, block, sbi->s_itb_per_group, GFP_NOFS);
 	if (err)
Signature · 1 line
1.7.3.1
#2 lore raw

Hi,

Quoted 2 lines

s_itb_per_group is defined to be an unsigned long, so a much better fix is simply to change the format string.

Thanks for your work. ;)

Quoted 57 lines · Ted Ts'o

Review

Quoted 3 lines · Akira Fujita
         ext4_debug("clear inode table blocks %#04llx ->  %#04llx\n",
(quoted diff) +1 -1
-                       block, sbi->s_itb_per_group);
+                       block, (ext4_fsblk_t)sbi->s_itb_per_group);

s_itb_per_group is defined to be an unsigned long, so a much better fix is simply to change the format string.

- Ted

Quoted 1 line

From da488945f4bf4096f4ab6091938469bd8822cfec Mon Sep 17 00:00:00 2001

From: Theodore Ts'o<[email protected]>
Date: Mon, 21 Feb 2011 20:39:58 -0500
Subject: [PATCH] ext4: fix compile warnings with EXT4FS_DEBUG enabled

Compile 2.6.38-rc1 with turning EXT4FS_DEBUG on, we get following compile warnings. This patch fixes them.

CC fs/ext4/hash.o
CC fs/ext4/resize.o
fs/ext4/resize.c: In function 'setup_new_group_blocks':
fs/ext4/resize.c:233:2: warning: format '%#04llx' expects type 'long long unsigned int', but argument 3 has type 'long unsigned int' fs/ext4/resize.c:251:2: warning: format '%#04llx' expects type 'long long unsigned int', but argument 3 has type 'long unsigned int'

   CC      fs/ext4/extents.o
   CC      fs/ext4/ext4_jbd2.o
   CC      fs/ext4/migrate.o
---
  fs/ext4/resize.c |    4 ++--
  1 files changed, 2 insertions(+), 2 deletions(-)
fs/ext4/resize.c +2 -2
index 3ecc6e4..66fec4e 100644
@@ -230,7 +230,7 @@ static int setup_new_group_blocks(struct super_block *sb,
  	}
 
  	/* Zero out all of the reserved backup group descriptor table blocks */
-	ext4_debug("clear inode table blocks %#04llx ->  %#04llx\n",
+	ext4_debug("clear inode table blocks %#04llx ->  %#04lx\n",
  			block, sbi->s_itb_per_group);
  	err = sb_issue_zeroout(sb, gdblocks + start + 1, reserved_gdb,
  			       GFP_NOFS);
@@ -248,7 +248,7 @@ static int setup_new_group_blocks(struct super_block *sb,
 
  	/* Zero out all of the inode table blocks */
  	block = input->inode_table;
-	ext4_debug("clear inode table blocks %#04llx ->  %#04llx\n",
+	ext4_debug("clear inode table blocks %#04llx ->  %#04lx\n",
  			block, sbi->s_itb_per_group);
  	err = sb_issue_zeroout(sb, block, sbi->s_itb_per_group, GFP_NOFS);
  	if (err)