linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH -mm] hpfs: fix printk format warnings
@ 2006-11-18  7:12 Randy Dunlap
  2006-11-19 16:25 ` Mikulas Patocka
  0 siblings, 1 reply; 4+ messages in thread
From: Randy Dunlap @ 2006-11-18  7:12 UTC (permalink / raw)
  To: linux-fsdevel; +Cc: mikulas, akpm

From: Randy Dunlap <randy.dunlap@oracle.com>

Fix hpfs printk warnings:
(why do I only see these in -mm?)

fs/hpfs/dir.c:87: warning: format '%08x' expects type 'unsigned int', but argument 3 has type 'long unsigned int'
fs/hpfs/dir.c:147: warning: format '%08x' expects type 'unsigned int', but argument 3 has type 'long int'
fs/hpfs/dir.c:148: warning: format '%08x' expects type 'unsigned int', but argument 3 has type 'long int'
fs/hpfs/dnode.c:537: warning: format '%08x' expects type 'unsigned int', but argument 5 has type 'long unsigned int'
fs/hpfs/dnode.c:854: warning: format '%08x' expects type 'unsigned int', but argument 3 has type 'loff_t'
fs/hpfs/ea.c:247: warning: format '%08x' expects type 'unsigned int', but argument 3 has type 'long unsigned int'
fs/hpfs/inode.c:254: warning: format '%08x' expects type 'unsigned int', but argument 3 has type 'long unsigned int'
fs/hpfs/map.c:129: warning: format '%08x' expects type 'unsigned int', but argument 3 has type 'ino_t'
fs/hpfs/map.c:135: warning: format '%08x' expects type 'unsigned int', but argument 3 has type 'ino_t'
fs/hpfs/map.c:140: warning: format '%08x' expects type 'unsigned int', but argument 3 has type 'ino_t'
fs/hpfs/map.c:147: warning: format '%08x' expects type 'unsigned int', but argument 3 has type 'ino_t'
fs/hpfs/map.c:154: warning: format '%08x' expects type 'unsigned int', but argument 3 has type 'ino_t'

Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com>
---
 fs/hpfs/dir.c   |   10 +++++++---
 fs/hpfs/dnode.c |   13 +++++++++----
 fs/hpfs/ea.c    |    2 +-
 fs/hpfs/inode.c |    5 ++++-
 fs/hpfs/map.c   |   20 ++++++++++++++------
 5 files changed, 35 insertions(+), 15 deletions(-)

--- linux-2619-rc5mm2.orig/fs/hpfs/dir.c
+++ linux-2619-rc5mm2/fs/hpfs/dir.c
@@ -84,7 +84,8 @@ static int hpfs_readdir(struct file *fil
 		}
 		if (!fno->dirflag) {
 			e = 1;
-			hpfs_error(inode->i_sb, "not a directory, fnode %08x",inode->i_ino);
+			hpfs_error(inode->i_sb, "not a directory, fnode %08lx",
+					inode->i_ino);
 		}
 		if (hpfs_inode->i_dno != fno->u.external[0].disk_secno) {
 			e = 1;
@@ -144,8 +145,11 @@ static int hpfs_readdir(struct file *fil
 		}
 		if (de->first || de->last) {
 			if (hpfs_sb(inode->i_sb)->sb_chk) {
-				if (de->first && !de->last && (de->namelen != 2 || de ->name[0] != 1 || de->name[1] != 1)) hpfs_error(inode->i_sb, "hpfs_readdir: bad ^A^A entry; pos = %08x", old_pos);
-				if (de->last && (de->namelen != 1 || de ->name[0] != 255)) hpfs_error(inode->i_sb, "hpfs_readdir: bad \\377 entry; pos = %08x", old_pos);
+				if (de->first && !de->last && (de->namelen != 2
+				    || de ->name[0] != 1 || de->name[1] != 1))
+					hpfs_error(inode->i_sb, "hpfs_readdir: bad ^A^A entry; pos = %08lx", old_pos);
+				if (de->last && (de->namelen != 1 || de ->name[0] != 255))
+					hpfs_error(inode->i_sb, "hpfs_readdir: bad \\377 entry; pos = %08lx", old_pos);
 			}
 			hpfs_brelse4(&qbh);
 			goto again;
--- linux-2619-rc5mm2.orig/fs/hpfs/dnode.c
+++ linux-2619-rc5mm2/fs/hpfs/dnode.c
@@ -533,10 +533,13 @@ static void delete_empty_dnode(struct in
 			struct buffer_head *bh;
 			struct dnode *d1;
 			struct quad_buffer_head qbh1;
-			if (hpfs_sb(i->i_sb)->sb_chk) if (up != i->i_ino) {
-				hpfs_error(i->i_sb, "bad pointer to fnode, dnode %08x, pointing to %08x, should be %08x", dno, up, i->i_ino);
+			if (hpfs_sb(i->i_sb)->sb_chk)
+			    if (up != i->i_ino) {
+				hpfs_error(i->i_sb,
+					"bad pointer to fnode, dnode %08x, pointing to %08x, should be %08lx",
+					dno, up, i->i_ino);
 				return;
-			}
+			    }
 			if ((d1 = hpfs_map_dnode(i->i_sb, down, &qbh1))) {
 				d1->up = up;
 				d1->root_dnode = 1;
@@ -851,7 +854,9 @@ struct hpfs_dirent *map_pos_dirent(struc
 	/* Going to the next dirent */
 	if ((d = de_next_de(de)) < dnode_end_de(dnode)) {
 		if (!(++*posp & 077)) {
-			hpfs_error(inode->i_sb, "map_pos_dirent: pos crossed dnode boundary; pos = %08x", *posp);
+			hpfs_error(inode->i_sb,
+				"map_pos_dirent: pos crossed dnode boundary; pos = %08llx",
+				(unsigned long long)*posp);
 			goto bail;
 		}
 		/* We're going down the tree */
--- linux-2619-rc5mm2.orig/fs/hpfs/ea.c
+++ linux-2619-rc5mm2/fs/hpfs/ea.c
@@ -243,7 +243,7 @@ void hpfs_set_ea(struct inode *inode, st
 		fnode->ea_offs = 0xc4;
 	}
 	if (fnode->ea_offs < 0xc4 || fnode->ea_offs + fnode->acl_size_s + fnode->ea_size_s > 0x200) {
-		hpfs_error(s, "fnode %08x: ea_offs == %03x, ea_size_s == %03x",
+		hpfs_error(s, "fnode %08lx: ea_offs == %03x, ea_size_s == %03x",
 			inode->i_ino, fnode->ea_offs, fnode->ea_size_s);
 		return;
 	}
--- linux-2619-rc5mm2.orig/fs/hpfs/inode.c
+++ linux-2619-rc5mm2/fs/hpfs/inode.c
@@ -251,7 +251,10 @@ void hpfs_write_inode_nolock(struct inod
 			de->file_size = 0;
 			hpfs_mark_4buffers_dirty(&qbh);
 			hpfs_brelse4(&qbh);
-		} else hpfs_error(i->i_sb, "directory %08x doesn't have '.' entry", i->i_ino);
+		} else
+			hpfs_error(i->i_sb,
+				"directory %08lx doesn't have '.' entry",
+				i->i_ino);
 	}
 	mark_buffer_dirty(bh);
 	brelse(bh);
--- linux-2619-rc5mm2.orig/fs/hpfs/map.c
+++ linux-2619-rc5mm2/fs/hpfs/map.c
@@ -126,32 +126,40 @@ struct fnode *hpfs_map_fnode(struct supe
 			struct extended_attribute *ea;
 			struct extended_attribute *ea_end;
 			if (fnode->magic != FNODE_MAGIC) {
-				hpfs_error(s, "bad magic on fnode %08x", ino);
+				hpfs_error(s, "bad magic on fnode %08lx",
+					(unsigned long)ino);
 				goto bail;
 			}
 			if (!fnode->dirflag) {
 				if ((unsigned)fnode->btree.n_used_nodes + (unsigned)fnode->btree.n_free_nodes !=
 				    (fnode->btree.internal ? 12 : 8)) {
-					hpfs_error(s, "bad number of nodes in fnode %08x", ino);
+					hpfs_error(s,
+					   "bad number of nodes in fnode %08lx",
+					    (unsigned long)ino);
 					goto bail;
 				}
 				if (fnode->btree.first_free !=
 				    8 + fnode->btree.n_used_nodes * (fnode->btree.internal ? 8 : 12)) {
-					hpfs_error(s, "bad first_free pointer in fnode %08x", ino);
+					hpfs_error(s,
+					    "bad first_free pointer in fnode %08lx",
+					    (unsigned long)ino);
 					goto bail;
 				}
 			}
 			if (fnode->ea_size_s && ((signed int)fnode->ea_offs < 0xc4 ||
 			   (signed int)fnode->ea_offs + fnode->acl_size_s + fnode->ea_size_s > 0x200)) {
-				hpfs_error(s, "bad EA info in fnode %08x: ea_offs == %04x ea_size_s == %04x",
-					ino, fnode->ea_offs, fnode->ea_size_s);
+				hpfs_error(s,
+					"bad EA info in fnode %08lx: ea_offs == %04x ea_size_s == %04x",
+					(unsigned long)ino,
+					fnode->ea_offs, fnode->ea_size_s);
 				goto bail;
 			}
 			ea = fnode_ea(fnode);
 			ea_end = fnode_end_ea(fnode);
 			while (ea != ea_end) {
 				if (ea > ea_end) {
-					hpfs_error(s, "bad EA in fnode %08x", ino);
+					hpfs_error(s, "bad EA in fnode %08lx",
+						(unsigned long)ino);
 					goto bail;
 				}
 				ea = next_ea(ea);


---

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

* Re: [PATCH -mm] hpfs: fix printk format warnings
  2006-11-18  7:12 [PATCH -mm] hpfs: fix printk format warnings Randy Dunlap
@ 2006-11-19 16:25 ` Mikulas Patocka
  2006-11-19 18:46   ` [PATCH -mm v2] " Randy Dunlap
  0 siblings, 1 reply; 4+ messages in thread
From: Mikulas Patocka @ 2006-11-19 16:25 UTC (permalink / raw)
  To: Randy Dunlap; +Cc: linux-fsdevel, akpm

> From: Randy Dunlap <randy.dunlap@oracle.com>
>
> Fix hpfs printk warnings:
> (why do I only see these in -mm?)

Probably because -mm has unsigned long inode number and Linus' kernel has 
just unsigned int?

Change it this way:
hpfs_error(inode->i_sb, "not a directory, fnode %08lx", 
(unsigned long)inode->i_ino);
--- so that it can work on both.

Mikulas

> fs/hpfs/dir.c:87: warning: format '%08x' expects type 'unsigned int', but argument 3 has type 'long unsigned int'
> fs/hpfs/dir.c:147: warning: format '%08x' expects type 'unsigned int', but argument 3 has type 'long int'
> fs/hpfs/dir.c:148: warning: format '%08x' expects type 'unsigned int', but argument 3 has type 'long int'
> fs/hpfs/dnode.c:537: warning: format '%08x' expects type 'unsigned int', but argument 5 has type 'long unsigned int'
> fs/hpfs/dnode.c:854: warning: format '%08x' expects type 'unsigned int', but argument 3 has type 'loff_t'
> fs/hpfs/ea.c:247: warning: format '%08x' expects type 'unsigned int', but argument 3 has type 'long unsigned int'
> fs/hpfs/inode.c:254: warning: format '%08x' expects type 'unsigned int', but argument 3 has type 'long unsigned int'
> fs/hpfs/map.c:129: warning: format '%08x' expects type 'unsigned int', but argument 3 has type 'ino_t'
> fs/hpfs/map.c:135: warning: format '%08x' expects type 'unsigned int', but argument 3 has type 'ino_t'
> fs/hpfs/map.c:140: warning: format '%08x' expects type 'unsigned int', but argument 3 has type 'ino_t'
> fs/hpfs/map.c:147: warning: format '%08x' expects type 'unsigned int', but argument 3 has type 'ino_t'
> fs/hpfs/map.c:154: warning: format '%08x' expects type 'unsigned int', but argument 3 has type 'ino_t'
>
> Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com>
> ---
> fs/hpfs/dir.c   |   10 +++++++---
> fs/hpfs/dnode.c |   13 +++++++++----
> fs/hpfs/ea.c    |    2 +-
> fs/hpfs/inode.c |    5 ++++-
> fs/hpfs/map.c   |   20 ++++++++++++++------
> 5 files changed, 35 insertions(+), 15 deletions(-)
>
> --- linux-2619-rc5mm2.orig/fs/hpfs/dir.c
> +++ linux-2619-rc5mm2/fs/hpfs/dir.c
> @@ -84,7 +84,8 @@ static int hpfs_readdir(struct file *fil
> 		}
> 		if (!fno->dirflag) {
> 			e = 1;
> -			hpfs_error(inode->i_sb, "not a directory, fnode %08x",inode->i_ino);
> +			hpfs_error(inode->i_sb, "not a directory, fnode %08lx",
> +					inode->i_ino);
> 		}
> 		if (hpfs_inode->i_dno != fno->u.external[0].disk_secno) {
> 			e = 1;
> @@ -144,8 +145,11 @@ static int hpfs_readdir(struct file *fil
> 		}
> 		if (de->first || de->last) {
> 			if (hpfs_sb(inode->i_sb)->sb_chk) {
> -				if (de->first && !de->last && (de->namelen != 2 || de ->name[0] != 1 || de->name[1] != 1)) hpfs_error(inode->i_sb, "hpfs_readdir: bad ^A^A entry; pos = %08x", old_pos);
> -				if (de->last && (de->namelen != 1 || de ->name[0] != 255)) hpfs_error(inode->i_sb, "hpfs_readdir: bad \\377 entry; pos = %08x", old_pos);
> +				if (de->first && !de->last && (de->namelen != 2
> +				    || de ->name[0] != 1 || de->name[1] != 1))
> +					hpfs_error(inode->i_sb, "hpfs_readdir: bad ^A^A entry; pos = %08lx", old_pos);
> +				if (de->last && (de->namelen != 1 || de ->name[0] != 255))
> +					hpfs_error(inode->i_sb, "hpfs_readdir: bad \\377 entry; pos = %08lx", old_pos);
> 			}
> 			hpfs_brelse4(&qbh);
> 			goto again;
> --- linux-2619-rc5mm2.orig/fs/hpfs/dnode.c
> +++ linux-2619-rc5mm2/fs/hpfs/dnode.c
> @@ -533,10 +533,13 @@ static void delete_empty_dnode(struct in
> 			struct buffer_head *bh;
> 			struct dnode *d1;
> 			struct quad_buffer_head qbh1;
> -			if (hpfs_sb(i->i_sb)->sb_chk) if (up != i->i_ino) {
> -				hpfs_error(i->i_sb, "bad pointer to fnode, dnode %08x, pointing to %08x, should be %08x", dno, up, i->i_ino);
> +			if (hpfs_sb(i->i_sb)->sb_chk)
> +			    if (up != i->i_ino) {
> +				hpfs_error(i->i_sb,
> +					"bad pointer to fnode, dnode %08x, pointing to %08x, should be %08lx",
> +					dno, up, i->i_ino);
> 				return;
> -			}
> +			    }
> 			if ((d1 = hpfs_map_dnode(i->i_sb, down, &qbh1))) {
> 				d1->up = up;
> 				d1->root_dnode = 1;
> @@ -851,7 +854,9 @@ struct hpfs_dirent *map_pos_dirent(struc
> 	/* Going to the next dirent */
> 	if ((d = de_next_de(de)) < dnode_end_de(dnode)) {
> 		if (!(++*posp & 077)) {
> -			hpfs_error(inode->i_sb, "map_pos_dirent: pos crossed dnode boundary; pos = %08x", *posp);
> +			hpfs_error(inode->i_sb,
> +				"map_pos_dirent: pos crossed dnode boundary; pos = %08llx",
> +				(unsigned long long)*posp);
> 			goto bail;
> 		}
> 		/* We're going down the tree */
> --- linux-2619-rc5mm2.orig/fs/hpfs/ea.c
> +++ linux-2619-rc5mm2/fs/hpfs/ea.c
> @@ -243,7 +243,7 @@ void hpfs_set_ea(struct inode *inode, st
> 		fnode->ea_offs = 0xc4;
> 	}
> 	if (fnode->ea_offs < 0xc4 || fnode->ea_offs + fnode->acl_size_s + fnode->ea_size_s > 0x200) {
> -		hpfs_error(s, "fnode %08x: ea_offs == %03x, ea_size_s == %03x",
> +		hpfs_error(s, "fnode %08lx: ea_offs == %03x, ea_size_s == %03x",
> 			inode->i_ino, fnode->ea_offs, fnode->ea_size_s);
> 		return;
> 	}
> --- linux-2619-rc5mm2.orig/fs/hpfs/inode.c
> +++ linux-2619-rc5mm2/fs/hpfs/inode.c
> @@ -251,7 +251,10 @@ void hpfs_write_inode_nolock(struct inod
> 			de->file_size = 0;
> 			hpfs_mark_4buffers_dirty(&qbh);
> 			hpfs_brelse4(&qbh);
> -		} else hpfs_error(i->i_sb, "directory %08x doesn't have '.' entry", i->i_ino);
> +		} else
> +			hpfs_error(i->i_sb,
> +				"directory %08lx doesn't have '.' entry",
> +				i->i_ino);
> 	}
> 	mark_buffer_dirty(bh);
> 	brelse(bh);
> --- linux-2619-rc5mm2.orig/fs/hpfs/map.c
> +++ linux-2619-rc5mm2/fs/hpfs/map.c
> @@ -126,32 +126,40 @@ struct fnode *hpfs_map_fnode(struct supe
> 			struct extended_attribute *ea;
> 			struct extended_attribute *ea_end;
> 			if (fnode->magic != FNODE_MAGIC) {
> -				hpfs_error(s, "bad magic on fnode %08x", ino);
> +				hpfs_error(s, "bad magic on fnode %08lx",
> +					(unsigned long)ino);
> 				goto bail;
> 			}
> 			if (!fnode->dirflag) {
> 				if ((unsigned)fnode->btree.n_used_nodes + (unsigned)fnode->btree.n_free_nodes !=
> 				    (fnode->btree.internal ? 12 : 8)) {
> -					hpfs_error(s, "bad number of nodes in fnode %08x", ino);
> +					hpfs_error(s,
> +					   "bad number of nodes in fnode %08lx",
> +					    (unsigned long)ino);
> 					goto bail;
> 				}
> 				if (fnode->btree.first_free !=
> 				    8 + fnode->btree.n_used_nodes * (fnode->btree.internal ? 8 : 12)) {
> -					hpfs_error(s, "bad first_free pointer in fnode %08x", ino);
> +					hpfs_error(s,
> +					    "bad first_free pointer in fnode %08lx",
> +					    (unsigned long)ino);
> 					goto bail;
> 				}
> 			}
> 			if (fnode->ea_size_s && ((signed int)fnode->ea_offs < 0xc4 ||
> 			   (signed int)fnode->ea_offs + fnode->acl_size_s + fnode->ea_size_s > 0x200)) {
> -				hpfs_error(s, "bad EA info in fnode %08x: ea_offs == %04x ea_size_s == %04x",
> -					ino, fnode->ea_offs, fnode->ea_size_s);
> +				hpfs_error(s,
> +					"bad EA info in fnode %08lx: ea_offs == %04x ea_size_s == %04x",
> +					(unsigned long)ino,
> +					fnode->ea_offs, fnode->ea_size_s);
> 				goto bail;
> 			}
> 			ea = fnode_ea(fnode);
> 			ea_end = fnode_end_ea(fnode);
> 			while (ea != ea_end) {
> 				if (ea > ea_end) {
> -					hpfs_error(s, "bad EA in fnode %08x", ino);
> +					hpfs_error(s, "bad EA in fnode %08lx",
> +						(unsigned long)ino);
> 					goto bail;
> 				}
> 				ea = next_ea(ea);
>
>
> ---
>

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

* [PATCH -mm v2] hpfs: fix printk format warnings
  2006-11-19 16:25 ` Mikulas Patocka
@ 2006-11-19 18:46   ` Randy Dunlap
  2006-11-21 23:43     ` Mikulas Patocka
  0 siblings, 1 reply; 4+ messages in thread
From: Randy Dunlap @ 2006-11-19 18:46 UTC (permalink / raw)
  To: Mikulas Patocka; +Cc: linux-fsdevel, akpm

On Sun, 19 Nov 2006 17:25:50 +0100 (CET) Mikulas Patocka wrote:

> > From: Randy Dunlap <randy.dunlap@oracle.com>
> >
> > Fix hpfs printk warnings:
> > (why do I only see these in -mm?)
> 
> Probably because -mm has unsigned long inode number and Linus' kernel has 
> just unsigned int?
> 
> Change it this way:
> hpfs_error(inode->i_sb, "not a directory, fnode %08lx", 
> (unsigned long)inode->i_ino);
> --- so that it can work on both.

OK, remade/resend.
---
From: Randy Dunlap <randy.dunlap@oracle.com>

Fix hpfs printk warnings:

fs/hpfs/dir.c:87: warning: format '%08x' expects type 'unsigned int', but argument 3 has type 'long unsigned int'
fs/hpfs/dir.c:147: warning: format '%08x' expects type 'unsigned int', but argument 3 has type 'long int'
fs/hpfs/dir.c:148: warning: format '%08x' expects type 'unsigned int', but argument 3 has type 'long int'
fs/hpfs/dnode.c:537: warning: format '%08x' expects type 'unsigned int', but argument 5 has type 'long unsigned int'
fs/hpfs/dnode.c:854: warning: format '%08x' expects type 'unsigned int', but argument 3 has type 'loff_t'
fs/hpfs/ea.c:247: warning: format '%08x' expects type 'unsigned int', but argument 3 has type 'long unsigned int'
fs/hpfs/inode.c:254: warning: format '%08x' expects type 'unsigned int', but argument 3 has type 'long unsigned int'
fs/hpfs/map.c:129: warning: format '%08x' expects type 'unsigned int', but argument 3 has type 'ino_t'
fs/hpfs/map.c:135: warning: format '%08x' expects type 'unsigned int', but argument 3 has type 'ino_t'
fs/hpfs/map.c:140: warning: format '%08x' expects type 'unsigned int', but argument 3 has type 'ino_t'
fs/hpfs/map.c:147: warning: format '%08x' expects type 'unsigned int', but argument 3 has type 'ino_t'
fs/hpfs/map.c:154: warning: format '%08x' expects type 'unsigned int', but argument 3 has type 'ino_t'

Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com>
---
 fs/hpfs/dir.c   |   10 +++++++---
 fs/hpfs/dnode.c |   13 +++++++++----
 fs/hpfs/ea.c    |    5 +++--
 fs/hpfs/inode.c |    5 ++++-
 fs/hpfs/map.c   |   20 ++++++++++++++------
 5 files changed, 37 insertions(+), 16 deletions(-)

--- linux-2619-rc5mm2.orig/fs/hpfs/dir.c
+++ linux-2619-rc5mm2/fs/hpfs/dir.c
@@ -84,7 +84,8 @@ static int hpfs_readdir(struct file *fil
 		}
 		if (!fno->dirflag) {
 			e = 1;
-			hpfs_error(inode->i_sb, "not a directory, fnode %08x",inode->i_ino);
+			hpfs_error(inode->i_sb, "not a directory, fnode %08lx",
+					(unsigned long)inode->i_ino);
 		}
 		if (hpfs_inode->i_dno != fno->u.external[0].disk_secno) {
 			e = 1;
@@ -144,8 +145,11 @@ static int hpfs_readdir(struct file *fil
 		}
 		if (de->first || de->last) {
 			if (hpfs_sb(inode->i_sb)->sb_chk) {
-				if (de->first && !de->last && (de->namelen != 2 || de ->name[0] != 1 || de->name[1] != 1)) hpfs_error(inode->i_sb, "hpfs_readdir: bad ^A^A entry; pos = %08x", old_pos);
-				if (de->last && (de->namelen != 1 || de ->name[0] != 255)) hpfs_error(inode->i_sb, "hpfs_readdir: bad \\377 entry; pos = %08x", old_pos);
+				if (de->first && !de->last && (de->namelen != 2
+				    || de ->name[0] != 1 || de->name[1] != 1))
+					hpfs_error(inode->i_sb, "hpfs_readdir: bad ^A^A entry; pos = %08lx", old_pos);
+				if (de->last && (de->namelen != 1 || de ->name[0] != 255))
+					hpfs_error(inode->i_sb, "hpfs_readdir: bad \\377 entry; pos = %08lx", old_pos);
 			}
 			hpfs_brelse4(&qbh);
 			goto again;
--- linux-2619-rc5mm2.orig/fs/hpfs/dnode.c
+++ linux-2619-rc5mm2/fs/hpfs/dnode.c
@@ -533,10 +533,13 @@ static void delete_empty_dnode(struct in
 			struct buffer_head *bh;
 			struct dnode *d1;
 			struct quad_buffer_head qbh1;
-			if (hpfs_sb(i->i_sb)->sb_chk) if (up != i->i_ino) {
-				hpfs_error(i->i_sb, "bad pointer to fnode, dnode %08x, pointing to %08x, should be %08x", dno, up, i->i_ino);
+			if (hpfs_sb(i->i_sb)->sb_chk)
+			    if (up != i->i_ino) {
+				hpfs_error(i->i_sb,
+					"bad pointer to fnode, dnode %08x, pointing to %08x, should be %08lx",
+					dno, up, (unsigned long)i->i_ino);
 				return;
-			}
+			    }
 			if ((d1 = hpfs_map_dnode(i->i_sb, down, &qbh1))) {
 				d1->up = up;
 				d1->root_dnode = 1;
@@ -851,7 +854,9 @@ struct hpfs_dirent *map_pos_dirent(struc
 	/* Going to the next dirent */
 	if ((d = de_next_de(de)) < dnode_end_de(dnode)) {
 		if (!(++*posp & 077)) {
-			hpfs_error(inode->i_sb, "map_pos_dirent: pos crossed dnode boundary; pos = %08x", *posp);
+			hpfs_error(inode->i_sb,
+				"map_pos_dirent: pos crossed dnode boundary; pos = %08llx",
+				(unsigned long long)*posp);
 			goto bail;
 		}
 		/* We're going down the tree */
--- linux-2619-rc5mm2.orig/fs/hpfs/ea.c
+++ linux-2619-rc5mm2/fs/hpfs/ea.c
@@ -243,8 +243,9 @@ void hpfs_set_ea(struct inode *inode, st
 		fnode->ea_offs = 0xc4;
 	}
 	if (fnode->ea_offs < 0xc4 || fnode->ea_offs + fnode->acl_size_s + fnode->ea_size_s > 0x200) {
-		hpfs_error(s, "fnode %08x: ea_offs == %03x, ea_size_s == %03x",
-			inode->i_ino, fnode->ea_offs, fnode->ea_size_s);
+		hpfs_error(s, "fnode %08lx: ea_offs == %03x, ea_size_s == %03x",
+			(unsigned long)inode->i_ino,
+			fnode->ea_offs, fnode->ea_size_s);
 		return;
 	}
 	if ((fnode->ea_size_s || !fnode->ea_size_l) &&
--- linux-2619-rc5mm2.orig/fs/hpfs/inode.c
+++ linux-2619-rc5mm2/fs/hpfs/inode.c
@@ -251,7 +251,10 @@ void hpfs_write_inode_nolock(struct inod
 			de->file_size = 0;
 			hpfs_mark_4buffers_dirty(&qbh);
 			hpfs_brelse4(&qbh);
-		} else hpfs_error(i->i_sb, "directory %08x doesn't have '.' entry", i->i_ino);
+		} else
+			hpfs_error(i->i_sb,
+				"directory %08lx doesn't have '.' entry",
+				(unsigned long)i->i_ino);
 	}
 	mark_buffer_dirty(bh);
 	brelse(bh);
--- linux-2619-rc5mm2.orig/fs/hpfs/map.c
+++ linux-2619-rc5mm2/fs/hpfs/map.c
@@ -126,32 +126,40 @@ struct fnode *hpfs_map_fnode(struct supe
 			struct extended_attribute *ea;
 			struct extended_attribute *ea_end;
 			if (fnode->magic != FNODE_MAGIC) {
-				hpfs_error(s, "bad magic on fnode %08x", ino);
+				hpfs_error(s, "bad magic on fnode %08lx",
+					(unsigned long)ino);
 				goto bail;
 			}
 			if (!fnode->dirflag) {
 				if ((unsigned)fnode->btree.n_used_nodes + (unsigned)fnode->btree.n_free_nodes !=
 				    (fnode->btree.internal ? 12 : 8)) {
-					hpfs_error(s, "bad number of nodes in fnode %08x", ino);
+					hpfs_error(s,
+					   "bad number of nodes in fnode %08lx",
+					    (unsigned long)ino);
 					goto bail;
 				}
 				if (fnode->btree.first_free !=
 				    8 + fnode->btree.n_used_nodes * (fnode->btree.internal ? 8 : 12)) {
-					hpfs_error(s, "bad first_free pointer in fnode %08x", ino);
+					hpfs_error(s,
+					    "bad first_free pointer in fnode %08lx",
+					    (unsigned long)ino);
 					goto bail;
 				}
 			}
 			if (fnode->ea_size_s && ((signed int)fnode->ea_offs < 0xc4 ||
 			   (signed int)fnode->ea_offs + fnode->acl_size_s + fnode->ea_size_s > 0x200)) {
-				hpfs_error(s, "bad EA info in fnode %08x: ea_offs == %04x ea_size_s == %04x",
-					ino, fnode->ea_offs, fnode->ea_size_s);
+				hpfs_error(s,
+					"bad EA info in fnode %08lx: ea_offs == %04x ea_size_s == %04x",
+					(unsigned long)ino,
+					fnode->ea_offs, fnode->ea_size_s);
 				goto bail;
 			}
 			ea = fnode_ea(fnode);
 			ea_end = fnode_end_ea(fnode);
 			while (ea != ea_end) {
 				if (ea > ea_end) {
-					hpfs_error(s, "bad EA in fnode %08x", ino);
+					hpfs_error(s, "bad EA in fnode %08lx",
+						(unsigned long)ino);
 					goto bail;
 				}
 				ea = next_ea(ea);

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

* Re: [PATCH -mm v2] hpfs: fix printk format warnings
  2006-11-19 18:46   ` [PATCH -mm v2] " Randy Dunlap
@ 2006-11-21 23:43     ` Mikulas Patocka
  0 siblings, 0 replies; 4+ messages in thread
From: Mikulas Patocka @ 2006-11-21 23:43 UTC (permalink / raw)
  To: akpm; +Cc: linux-fsdevel, Randy Dunlap

OK, let Andy commit it.

Signed-off-by: Mikulas Patocka <mikulas@artax.karlin.mff.cuni.cz>

>>> From: Randy Dunlap <randy.dunlap@oracle.com>
>>>
>>> Fix hpfs printk warnings:
>>> (why do I only see these in -mm?)
>>
>> Probably because -mm has unsigned long inode number and Linus' kernel has
>> just unsigned int?
>>
>> Change it this way:
>> hpfs_error(inode->i_sb, "not a directory, fnode %08lx",
>> (unsigned long)inode->i_ino);
>> --- so that it can work on both.
>
OK, remade/resend.
---
From: Randy Dunlap <randy.dunlap@oracle.com>
>
Fix hpfs printk warnings:
>
fs/hpfs/dir.c:87: warning: format '%08x' expects type 'unsigned int', but argument 3 has type 'long unsigned int'
fs/hpfs/dir.c:147: warning: format '%08x' expects type 'unsigned int', but argument 3 has type 'long int'
fs/hpfs/dir.c:148: warning: format '%08x' expects type 'unsigned int', but argument 3 has type 'long int'
fs/hpfs/dnode.c:537: warning: format '%08x' expects type 'unsigned int', but argument 5 has type 'long unsigned int'
fs/hpfs/dnode.c:854: warning: format '%08x' expects type 'unsigned int', but argument 3 has type 'loff_t'
fs/hpfs/ea.c:247: warning: format '%08x' expects type 'unsigned int', but argument 3 has type 'long unsigned int'
fs/hpfs/inode.c:254: warning: format '%08x' expects type 'unsigned int', but argument 3 has type 'long unsigned int'
fs/hpfs/map.c:129: warning: format '%08x' expects type 'unsigned int', but argument 3 has type 'ino_t'
fs/hpfs/map.c:135: warning: format '%08x' expects type 'unsigned int', but argument 3 has type 'ino_t'
fs/hpfs/map.c:140: warning: format '%08x' expects type 'unsigned int', but argument 3 has type 'ino_t'
fs/hpfs/map.c:147: warning: format '%08x' expects type 'unsigned int', but argument 3 has type 'ino_t'
fs/hpfs/map.c:154: warning: format '%08x' expects type 'unsigned int', but argument 3 has type 'ino_t'
>
Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com>
---
fs/hpfs/dir.c   |   10 +++++++---
fs/hpfs/dnode.c |   13 +++++++++----
fs/hpfs/ea.c    |    5 +++--
fs/hpfs/inode.c |    5 ++++-
fs/hpfs/map.c   |   20 ++++++++++++++------
5 files changed, 37 insertions(+), 16 deletions(-)
>
--- linux-2619-rc5mm2.orig/fs/hpfs/dir.c
+++ linux-2619-rc5mm2/fs/hpfs/dir.c
@@ -84,7 +84,8 @@ static int hpfs_readdir(struct file *fil
 		}
 		if (!fno->dirflag) {
 			e = 1;
-			hpfs_error(inode->i_sb, "not a directory, fnode %08x",inode->i_ino);
+			hpfs_error(inode->i_sb, "not a directory, fnode %08lx",
+					(unsigned long)inode->i_ino);
 		}
 		if (hpfs_inode->i_dno != fno->u.external[0].disk_secno) {
 			e = 1;
@@ -144,8 +145,11 @@ static int hpfs_readdir(struct file *fil
 		}
 		if (de->first || de->last) {
 			if (hpfs_sb(inode->i_sb)->sb_chk) {
-				if (de->first && !de->last && (de->namelen != 2 || de ->name[0] != 1 || de->name[1] != 1)) hpfs_error(inode->i_sb, "hpfs_readdir: bad ^A^A entry; pos = %08x", old_pos);
-				if (de->last && (de->namelen != 1 || de ->name[0] != 255)) hpfs_error(inode->i_sb, "hpfs_readdir: bad \\377 entry; pos = %08x", old_pos);
+				if (de->first && !de->last && (de->namelen != 2
+				    || de ->name[0] != 1 || de->name[1] != 1))
+					hpfs_error(inode->i_sb, "hpfs_readdir: bad ^A^A entry; pos = %08lx", old_pos);
+				if (de->last && (de->namelen != 1 || de ->name[0] != 255))
+					hpfs_error(inode->i_sb, "hpfs_readdir: bad \\377 entry; pos = %08lx", old_pos);
 			}
 			hpfs_brelse4(&qbh);
 			goto again;
--- linux-2619-rc5mm2.orig/fs/hpfs/dnode.c
+++ linux-2619-rc5mm2/fs/hpfs/dnode.c
@@ -533,10 +533,13 @@ static void delete_empty_dnode(struct in
 			struct buffer_head *bh;
 			struct dnode *d1;
 			struct quad_buffer_head qbh1;
-			if (hpfs_sb(i->i_sb)->sb_chk) if (up != i->i_ino) {
-				hpfs_error(i->i_sb, "bad pointer to fnode, dnode %08x, pointing to %08x, should be %08x", dno, up, i->i_ino);
+			if (hpfs_sb(i->i_sb)->sb_chk)
+			    if (up != i->i_ino) {
+				hpfs_error(i->i_sb,
+					"bad pointer to fnode, dnode %08x, pointing to %08x, should be %08lx",
+					dno, up, (unsigned long)i->i_ino);
 				return;
-			}
+			    }
 			if ((d1 = hpfs_map_dnode(i->i_sb, down, &qbh1))) {
 				d1->up = up;
 				d1->root_dnode = 1;
@@ -851,7 +854,9 @@ struct hpfs_dirent *map_pos_dirent(struc
 	/* Going to the next dirent */
 	if ((d = de_next_de(de)) < dnode_end_de(dnode)) {
 		if (!(++*posp & 077)) {
-			hpfs_error(inode->i_sb, "map_pos_dirent: pos crossed dnode boundary; pos = %08x", *posp);
+			hpfs_error(inode->i_sb,
+				"map_pos_dirent: pos crossed dnode boundary; pos = %08llx",
+				(unsigned long long)*posp);
 			goto bail;
 		}
 		/* We're going down the tree */
--- linux-2619-rc5mm2.orig/fs/hpfs/ea.c
+++ linux-2619-rc5mm2/fs/hpfs/ea.c
@@ -243,8 +243,9 @@ void hpfs_set_ea(struct inode *inode, st
 		fnode->ea_offs = 0xc4;
 	}
 	if (fnode->ea_offs < 0xc4 || fnode->ea_offs + fnode->acl_size_s + fnode->ea_size_s > 0x200) {
-		hpfs_error(s, "fnode %08x: ea_offs == %03x, ea_size_s == %03x",
-			inode->i_ino, fnode->ea_offs, fnode->ea_size_s);
+		hpfs_error(s, "fnode %08lx: ea_offs == %03x, ea_size_s == %03x",
+			(unsigned long)inode->i_ino,
+			fnode->ea_offs, fnode->ea_size_s);
 		return;
 	}
 	if ((fnode->ea_size_s || !fnode->ea_size_l) &&
--- linux-2619-rc5mm2.orig/fs/hpfs/inode.c
+++ linux-2619-rc5mm2/fs/hpfs/inode.c
@@ -251,7 +251,10 @@ void hpfs_write_inode_nolock(struct inod
 			de->file_size = 0;
 			hpfs_mark_4buffers_dirty(&qbh);
 			hpfs_brelse4(&qbh);
-		} else hpfs_error(i->i_sb, "directory %08x doesn't have '.' entry", i->i_ino);
+		} else
+			hpfs_error(i->i_sb,
+				"directory %08lx doesn't have '.' entry",
+				(unsigned long)i->i_ino);
 	}
 	mark_buffer_dirty(bh);
 	brelse(bh);
--- linux-2619-rc5mm2.orig/fs/hpfs/map.c
+++ linux-2619-rc5mm2/fs/hpfs/map.c
@@ -126,32 +126,40 @@ struct fnode *hpfs_map_fnode(struct supe
 			struct extended_attribute *ea;
 			struct extended_attribute *ea_end;
 			if (fnode->magic != FNODE_MAGIC) {
-				hpfs_error(s, "bad magic on fnode %08x", ino);
+				hpfs_error(s, "bad magic on fnode %08lx",
+					(unsigned long)ino);
 				goto bail;
 			}
 			if (!fnode->dirflag) {
 				if ((unsigned)fnode->btree.n_used_nodes + (unsigned)fnode->btree.n_free_nodes !=
 				    (fnode->btree.internal ? 12 : 8)) {
-					hpfs_error(s, "bad number of nodes in fnode %08x", ino);
+					hpfs_error(s,
+					   "bad number of nodes in fnode %08lx",
+					    (unsigned long)ino);
 					goto bail;
 				}
 				if (fnode->btree.first_free !=
 				    8 + fnode->btree.n_used_nodes * (fnode->btree.internal ? 8 : 12)) {
-					hpfs_error(s, "bad first_free pointer in fnode %08x", ino);
+					hpfs_error(s,
+					    "bad first_free pointer in fnode %08lx",
+					    (unsigned long)ino);
 					goto bail;
 				}
 			}
 			if (fnode->ea_size_s && ((signed int)fnode->ea_offs < 0xc4 ||
 			   (signed int)fnode->ea_offs + fnode->acl_size_s + fnode->ea_size_s > 0x200)) {
-				hpfs_error(s, "bad EA info in fnode %08x: ea_offs == %04x ea_size_s == %04x",
-					ino, fnode->ea_offs, fnode->ea_size_s);
+				hpfs_error(s,
+					"bad EA info in fnode %08lx: ea_offs == %04x ea_size_s == %04x",
+					(unsigned long)ino,
+					fnode->ea_offs, fnode->ea_size_s);
 				goto bail;
 			}
 			ea = fnode_ea(fnode);
 			ea_end = fnode_end_ea(fnode);
 			while (ea != ea_end) {
 				if (ea > ea_end) {
-					hpfs_error(s, "bad EA in fnode %08x", ino);
+					hpfs_error(s, "bad EA in fnode %08lx",
+						(unsigned long)ino);
 					goto bail;
 				}
 				ea = next_ea(ea);


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

end of thread, other threads:[~2006-11-21 23:43 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-11-18  7:12 [PATCH -mm] hpfs: fix printk format warnings Randy Dunlap
2006-11-19 16:25 ` Mikulas Patocka
2006-11-19 18:46   ` [PATCH -mm v2] " Randy Dunlap
2006-11-21 23:43     ` Mikulas Patocka

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