Skip to content

Commit 08fe100

Browse files
geertutorvalds
authored andcommitted
fs/affs: fix casting in printed messages
- "inode.i_ino" is "unsigned long", - "loff_t" is always "unsigned long long", - "sector_t" should be cast to "unsigned long long" for printing, - "u32" should not be cast to "unsigned int" for printing. Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
1 parent e22553e commit 08fe100

5 files changed

Lines changed: 33 additions & 40 deletions

File tree

‎fs/affs/amigaffs.c‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ affs_insert_hash(struct inode *dir, struct buffer_head *bh)
3030
ino = bh->b_blocknr;
3131
offset = affs_hash_name(sb, AFFS_TAIL(sb, bh)->name + 1, AFFS_TAIL(sb, bh)->name[0]);
3232

33-
pr_debug("%s(dir=%u, ino=%d)\n", __func__, (u32)dir->i_ino, ino);
33+
pr_debug("%s(dir=%lu, ino=%d)\n", __func__, dir->i_ino, ino);
3434

3535
dir_bh = affs_bread(sb, dir->i_ino);
3636
if (!dir_bh)
@@ -80,8 +80,8 @@ affs_remove_hash(struct inode *dir, struct buffer_head *rem_bh)
8080
sb = dir->i_sb;
8181
rem_ino = rem_bh->b_blocknr;
8282
offset = affs_hash_name(sb, AFFS_TAIL(sb, rem_bh)->name+1, AFFS_TAIL(sb, rem_bh)->name[0]);
83-
pr_debug("%s(dir=%d, ino=%d, hashval=%d)\n",
84-
__func__, (u32)dir->i_ino, rem_ino, offset);
83+
pr_debug("%s(dir=%lu, ino=%d, hashval=%d)\n", __func__, dir->i_ino,
84+
rem_ino, offset);
8585

8686
bh = affs_bread(sb, dir->i_ino);
8787
if (!bh)

‎fs/affs/dir.c‎

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,7 @@ affs_readdir(struct file *file, struct dir_context *ctx)
5454
u32 ino;
5555
int error = 0;
5656

57-
pr_debug("%s(ino=%lu,f_pos=%lx)\n",
58-
__func__, inode->i_ino, (unsigned long)ctx->pos);
57+
pr_debug("%s(ino=%lu,f_pos=%llx)\n", __func__, inode->i_ino, ctx->pos);
5958

6059
if (ctx->pos < 2) {
6160
file->private_data = (void *)0;
@@ -117,9 +116,8 @@ affs_readdir(struct file *file, struct dir_context *ctx)
117116

118117
namelen = min(AFFS_TAIL(sb, fh_bh)->name[0], (u8)30);
119118
name = AFFS_TAIL(sb, fh_bh)->name + 1;
120-
pr_debug("readdir(): dir_emit(\"%.*s\", "
121-
"ino=%u), hash=%d, f_pos=%x\n",
122-
namelen, name, ino, hash_pos, (u32)ctx->pos);
119+
pr_debug("readdir(): dir_emit(\"%.*s\", ino=%u), hash=%d, f_pos=%llx\n",
120+
namelen, name, ino, hash_pos, ctx->pos);
123121

124122
if (!dir_emit(ctx, name, namelen, ino, DT_UNKNOWN))
125123
goto done;

‎fs/affs/file.c‎

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -299,8 +299,8 @@ affs_get_block(struct inode *inode, sector_t block, struct buffer_head *bh_resul
299299
struct buffer_head *ext_bh;
300300
u32 ext;
301301

302-
pr_debug("%s(%u, %lu)\n",
303-
__func__, (u32)inode->i_ino, (unsigned long)block);
302+
pr_debug("%s(%lu, %llu)\n", __func__, inode->i_ino,
303+
(unsigned long long)block);
304304

305305
BUG_ON(block > (sector_t)0x7fffffffUL);
306306

@@ -330,8 +330,9 @@ affs_get_block(struct inode *inode, sector_t block, struct buffer_head *bh_resul
330330

331331
/* store new block */
332332
if (bh_result->b_blocknr)
333-
affs_warning(sb, "get_block", "block already set (%lx)",
334-
(unsigned long)bh_result->b_blocknr);
333+
affs_warning(sb, "get_block",
334+
"block already set (%llx)",
335+
(unsigned long long)bh_result->b_blocknr);
335336
AFFS_BLOCK(sb, ext_bh, block) = cpu_to_be32(blocknr);
336337
AFFS_HEAD(ext_bh)->block_count = cpu_to_be32(block + 1);
337338
affs_adjust_checksum(ext_bh, blocknr - bh_result->b_blocknr + 1);
@@ -353,8 +354,8 @@ affs_get_block(struct inode *inode, sector_t block, struct buffer_head *bh_resul
353354
return 0;
354355

355356
err_big:
356-
affs_error(inode->i_sb, "get_block", "strange block request %d",
357-
(int)block);
357+
affs_error(inode->i_sb, "get_block", "strange block request %llu",
358+
(unsigned long long)block);
358359
return -EIO;
359360
err_ext:
360361
// unlock cache
@@ -503,7 +504,7 @@ affs_do_readpage_ofs(struct page *page, unsigned to)
503504
u32 bidx, boff, bsize;
504505
u32 tmp;
505506

506-
pr_debug("%s(%u, %ld, 0, %d)\n", __func__, (u32)inode->i_ino,
507+
pr_debug("%s(%lu, %ld, 0, %d)\n", __func__, inode->i_ino,
507508
page->index, to);
508509
BUG_ON(to > PAGE_CACHE_SIZE);
509510
kmap(page);
@@ -539,7 +540,7 @@ affs_extent_file_ofs(struct inode *inode, u32 newsize)
539540
u32 size, bsize;
540541
u32 tmp;
541542

542-
pr_debug("%s(%u, %d)\n", __func__, (u32)inode->i_ino, newsize);
543+
pr_debug("%s(%lu, %d)\n", __func__, inode->i_ino, newsize);
543544
bsize = AFFS_SB(sb)->s_data_blksize;
544545
bh = NULL;
545546
size = AFFS_I(inode)->mmu_private;
@@ -608,7 +609,7 @@ affs_readpage_ofs(struct file *file, struct page *page)
608609
u32 to;
609610
int err;
610611

611-
pr_debug("%s(%u, %ld)\n", __func__, (u32)inode->i_ino, page->index);
612+
pr_debug("%s(%lu, %ld)\n", __func__, inode->i_ino, page->index);
612613
to = PAGE_CACHE_SIZE;
613614
if (((page->index + 1) << PAGE_CACHE_SHIFT) > inode->i_size) {
614615
to = inode->i_size & ~PAGE_CACHE_MASK;
@@ -631,8 +632,8 @@ static int affs_write_begin_ofs(struct file *file, struct address_space *mapping
631632
pgoff_t index;
632633
int err = 0;
633634

634-
pr_debug("%s(%u, %llu, %llu)\n", __func__, (u32)inode->i_ino,
635-
(unsigned long long)pos, (unsigned long long)pos + len);
635+
pr_debug("%s(%lu, %llu, %llu)\n", __func__, inode->i_ino, pos,
636+
pos + len);
636637
if (pos > AFFS_I(inode)->mmu_private) {
637638
/* XXX: this probably leaves a too-big i_size in case of
638639
* failure. Should really be updating i_size at write_end time
@@ -681,9 +682,8 @@ static int affs_write_end_ofs(struct file *file, struct address_space *mapping,
681682
* due to write_begin.
682683
*/
683684

684-
pr_debug("%s(%u, %llu, %llu)\n",
685-
__func__, (u32)inode->i_ino, (unsigned long long)pos,
686-
(unsigned long long)pos + len);
685+
pr_debug("%s(%lu, %llu, %llu)\n", __func__, inode->i_ino, pos,
686+
pos + len);
687687
bsize = AFFS_SB(sb)->s_data_blksize;
688688
data = page_address(page);
689689

@@ -831,8 +831,8 @@ affs_truncate(struct inode *inode)
831831
struct buffer_head *ext_bh;
832832
int i;
833833

834-
pr_debug("truncate(inode=%d, oldsize=%u, newsize=%u)\n",
835-
(u32)inode->i_ino, (u32)AFFS_I(inode)->mmu_private, (u32)inode->i_size);
834+
pr_debug("truncate(inode=%lu, oldsize=%llu, newsize=%llu)\n",
835+
inode->i_ino, AFFS_I(inode)->mmu_private, inode->i_size);
836836

837837
last_blk = 0;
838838
ext = 0;
@@ -863,7 +863,7 @@ affs_truncate(struct inode *inode)
863863
if (IS_ERR(ext_bh)) {
864864
affs_warning(sb, "truncate",
865865
"unexpected read error for ext block %u (%ld)",
866-
(unsigned int)ext, PTR_ERR(ext_bh));
866+
ext, PTR_ERR(ext_bh));
867867
return;
868868
}
869869
if (AFFS_I(inode)->i_lc) {
@@ -911,7 +911,7 @@ affs_truncate(struct inode *inode)
911911
if (IS_ERR(bh)) {
912912
affs_warning(sb, "truncate",
913913
"unexpected read error for last block %u (%ld)",
914-
(unsigned int)ext, PTR_ERR(bh));
914+
ext, PTR_ERR(bh));
915915
return;
916916
}
917917
tmp = be32_to_cpu(AFFS_DATA_HEAD(bh)->next);

‎fs/affs/inode.c‎

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -348,9 +348,8 @@ affs_add_entry(struct inode *dir, struct inode *inode, struct dentry *dentry, s3
348348
u32 block = 0;
349349
int retval;
350350

351-
pr_debug("%s(dir=%u, inode=%u, \"%pd\", type=%d)\n",
352-
__func__, (u32)dir->i_ino,
353-
(u32)inode->i_ino, dentry, type);
351+
pr_debug("%s(dir=%lu, inode=%lu, \"%pd\", type=%d)\n", __func__,
352+
dir->i_ino, inode->i_ino, dentry, type);
354353

355354
retval = -EIO;
356355
bh = affs_bread(sb, inode->i_ino);

‎fs/affs/namei.c‎

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -248,9 +248,8 @@ affs_lookup(struct inode *dir, struct dentry *dentry, unsigned int flags)
248248
int
249249
affs_unlink(struct inode *dir, struct dentry *dentry)
250250
{
251-
pr_debug("%s(dir=%d, %lu \"%pd\")\n",
252-
__func__, (u32)dir->i_ino, dentry->d_inode->i_ino,
253-
dentry);
251+
pr_debug("%s(dir=%lu, %lu \"%pd\")\n", __func__, dir->i_ino,
252+
dentry->d_inode->i_ino, dentry);
254253

255254
return affs_remove_header(dentry);
256255
}
@@ -317,9 +316,8 @@ affs_mkdir(struct inode *dir, struct dentry *dentry, umode_t mode)
317316
int
318317
affs_rmdir(struct inode *dir, struct dentry *dentry)
319318
{
320-
pr_debug("%s(dir=%u, %lu \"%pd\")\n",
321-
__func__, (u32)dir->i_ino, dentry->d_inode->i_ino,
322-
dentry);
319+
pr_debug("%s(dir=%lu, %lu \"%pd\")\n", __func__, dir->i_ino,
320+
dentry->d_inode->i_ino, dentry);
323321

324322
return affs_remove_header(dentry);
325323
}
@@ -404,8 +402,7 @@ affs_link(struct dentry *old_dentry, struct inode *dir, struct dentry *dentry)
404402
{
405403
struct inode *inode = old_dentry->d_inode;
406404

407-
pr_debug("%s(%u, %u, \"%pd\")\n",
408-
__func__, (u32)inode->i_ino, (u32)dir->i_ino,
405+
pr_debug("%s(%lu, %lu, \"%pd\")\n", __func__, inode->i_ino, dir->i_ino,
409406
dentry);
410407

411408
return affs_add_entry(dir, inode, dentry, ST_LINKFILE);
@@ -419,9 +416,8 @@ affs_rename(struct inode *old_dir, struct dentry *old_dentry,
419416
struct buffer_head *bh = NULL;
420417
int retval;
421418

422-
pr_debug("%s(old=%u,\"%pd\" to new=%u,\"%pd\")\n",
423-
__func__, (u32)old_dir->i_ino, old_dentry,
424-
(u32)new_dir->i_ino, new_dentry);
419+
pr_debug("%s(old=%lu,\"%pd\" to new=%lu,\"%pd\")\n", __func__,
420+
old_dir->i_ino, old_dentry, new_dir->i_ino, new_dentry);
425421

426422
retval = affs_check_name(new_dentry->d_name.name,
427423
new_dentry->d_name.len,

0 commit comments

Comments
 (0)