Skip to content

Commit 18debbb

Browse files
rddunlapLinus Torvalds
authored andcommitted
[PATCH] hpfs: fix printk format warnings
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> Cc: Alexey Dobriyan <adobriyan@gmail.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
1 parent 352d94d commit 18debbb

5 files changed

Lines changed: 37 additions & 16 deletions

File tree

fs/hpfs/dir.c

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,8 @@ static int hpfs_readdir(struct file *filp, void *dirent, filldir_t filldir)
8484
}
8585
if (!fno->dirflag) {
8686
e = 1;
87-
hpfs_error(inode->i_sb, "not a directory, fnode %08x",inode->i_ino);
87+
hpfs_error(inode->i_sb, "not a directory, fnode %08lx",
88+
(unsigned long)inode->i_ino);
8889
}
8990
if (hpfs_inode->i_dno != fno->u.external[0].disk_secno) {
9091
e = 1;
@@ -144,8 +145,11 @@ static int hpfs_readdir(struct file *filp, void *dirent, filldir_t filldir)
144145
}
145146
if (de->first || de->last) {
146147
if (hpfs_sb(inode->i_sb)->sb_chk) {
147-
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);
148-
if (de->last && (de->namelen != 1 || de ->name[0] != 255)) hpfs_error(inode->i_sb, "hpfs_readdir: bad \\377 entry; pos = %08x", old_pos);
148+
if (de->first && !de->last && (de->namelen != 2
149+
|| de ->name[0] != 1 || de->name[1] != 1))
150+
hpfs_error(inode->i_sb, "hpfs_readdir: bad ^A^A entry; pos = %08lx", old_pos);
151+
if (de->last && (de->namelen != 1 || de ->name[0] != 255))
152+
hpfs_error(inode->i_sb, "hpfs_readdir: bad \\377 entry; pos = %08lx", old_pos);
149153
}
150154
hpfs_brelse4(&qbh);
151155
goto again;

fs/hpfs/dnode.c

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -533,10 +533,13 @@ static void delete_empty_dnode(struct inode *i, dnode_secno dno)
533533
struct buffer_head *bh;
534534
struct dnode *d1;
535535
struct quad_buffer_head qbh1;
536-
if (hpfs_sb(i->i_sb)->sb_chk) if (up != i->i_ino) {
537-
hpfs_error(i->i_sb, "bad pointer to fnode, dnode %08x, pointing to %08x, should be %08x", dno, up, i->i_ino);
536+
if (hpfs_sb(i->i_sb)->sb_chk)
537+
if (up != i->i_ino) {
538+
hpfs_error(i->i_sb,
539+
"bad pointer to fnode, dnode %08x, pointing to %08x, should be %08lx",
540+
dno, up, (unsigned long)i->i_ino);
538541
return;
539-
}
542+
}
540543
if ((d1 = hpfs_map_dnode(i->i_sb, down, &qbh1))) {
541544
d1->up = up;
542545
d1->root_dnode = 1;
@@ -851,7 +854,9 @@ struct hpfs_dirent *map_pos_dirent(struct inode *inode, loff_t *posp,
851854
/* Going to the next dirent */
852855
if ((d = de_next_de(de)) < dnode_end_de(dnode)) {
853856
if (!(++*posp & 077)) {
854-
hpfs_error(inode->i_sb, "map_pos_dirent: pos crossed dnode boundary; pos = %08x", *posp);
857+
hpfs_error(inode->i_sb,
858+
"map_pos_dirent: pos crossed dnode boundary; pos = %08llx",
859+
(unsigned long long)*posp);
855860
goto bail;
856861
}
857862
/* We're going down the tree */

fs/hpfs/ea.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -243,8 +243,9 @@ void hpfs_set_ea(struct inode *inode, struct fnode *fnode, char *key, char *data
243243
fnode->ea_offs = 0xc4;
244244
}
245245
if (fnode->ea_offs < 0xc4 || fnode->ea_offs + fnode->acl_size_s + fnode->ea_size_s > 0x200) {
246-
hpfs_error(s, "fnode %08x: ea_offs == %03x, ea_size_s == %03x",
247-
inode->i_ino, fnode->ea_offs, fnode->ea_size_s);
246+
hpfs_error(s, "fnode %08lx: ea_offs == %03x, ea_size_s == %03x",
247+
(unsigned long)inode->i_ino,
248+
fnode->ea_offs, fnode->ea_size_s);
248249
return;
249250
}
250251
if ((fnode->ea_size_s || !fnode->ea_size_l) &&

fs/hpfs/inode.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,10 @@ void hpfs_write_inode_nolock(struct inode *i)
251251
de->file_size = 0;
252252
hpfs_mark_4buffers_dirty(&qbh);
253253
hpfs_brelse4(&qbh);
254-
} else hpfs_error(i->i_sb, "directory %08x doesn't have '.' entry", i->i_ino);
254+
} else
255+
hpfs_error(i->i_sb,
256+
"directory %08lx doesn't have '.' entry",
257+
(unsigned long)i->i_ino);
255258
}
256259
mark_buffer_dirty(bh);
257260
brelse(bh);

fs/hpfs/map.c

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -126,32 +126,40 @@ struct fnode *hpfs_map_fnode(struct super_block *s, ino_t ino, struct buffer_hea
126126
struct extended_attribute *ea;
127127
struct extended_attribute *ea_end;
128128
if (fnode->magic != FNODE_MAGIC) {
129-
hpfs_error(s, "bad magic on fnode %08x", ino);
129+
hpfs_error(s, "bad magic on fnode %08lx",
130+
(unsigned long)ino);
130131
goto bail;
131132
}
132133
if (!fnode->dirflag) {
133134
if ((unsigned)fnode->btree.n_used_nodes + (unsigned)fnode->btree.n_free_nodes !=
134135
(fnode->btree.internal ? 12 : 8)) {
135-
hpfs_error(s, "bad number of nodes in fnode %08x", ino);
136+
hpfs_error(s,
137+
"bad number of nodes in fnode %08lx",
138+
(unsigned long)ino);
136139
goto bail;
137140
}
138141
if (fnode->btree.first_free !=
139142
8 + fnode->btree.n_used_nodes * (fnode->btree.internal ? 8 : 12)) {
140-
hpfs_error(s, "bad first_free pointer in fnode %08x", ino);
143+
hpfs_error(s,
144+
"bad first_free pointer in fnode %08lx",
145+
(unsigned long)ino);
141146
goto bail;
142147
}
143148
}
144149
if (fnode->ea_size_s && ((signed int)fnode->ea_offs < 0xc4 ||
145150
(signed int)fnode->ea_offs + fnode->acl_size_s + fnode->ea_size_s > 0x200)) {
146-
hpfs_error(s, "bad EA info in fnode %08x: ea_offs == %04x ea_size_s == %04x",
147-
ino, fnode->ea_offs, fnode->ea_size_s);
151+
hpfs_error(s,
152+
"bad EA info in fnode %08lx: ea_offs == %04x ea_size_s == %04x",
153+
(unsigned long)ino,
154+
fnode->ea_offs, fnode->ea_size_s);
148155
goto bail;
149156
}
150157
ea = fnode_ea(fnode);
151158
ea_end = fnode_end_ea(fnode);
152159
while (ea != ea_end) {
153160
if (ea > ea_end) {
154-
hpfs_error(s, "bad EA in fnode %08x", ino);
161+
hpfs_error(s, "bad EA in fnode %08lx",
162+
(unsigned long)ino);
155163
goto bail;
156164
}
157165
ea = next_ea(ea);

0 commit comments

Comments
 (0)