ubifs: fix printk format warnings
PATCH 1/1 ubifs: fix printk format warnings
From: Randy Dunlap <[email protected]>
Fix printk format warnings in ubifs.
Built cleanly on 7 arches.
fs/ubifs/journal.c:693: warning: format '%lu' expects type 'long unsigned int', but argument 4 has type 'ino_t' fs/ubifs/journal.c:1131: warning: format '%lu' expects type 'long unsigned int', but argument 4 has type 'ino_t' fs/ubifs/dir.c:163: warning: format '%lu' expects type 'long unsigned int', but argument 4 has type 'ino_t' fs/ubifs/tnc.c:2680: warning: format '%lu' expects type 'long unsigned int', but argument 4 has type 'ino_t' fs/ubifs/tnc.c:2700: warning: format '%lu' expects type 'long unsigned int', but argument 5 has type 'ino_t' fs/ubifs/replay.c:1066: warning: format '%lu' expects type 'long unsigned int', but argument 7 has type 'ino_t' fs/ubifs/orphan.c:108: warning: format '%lu' expects type 'long unsigned int', but argument 4 has type 'ino_t' fs/ubifs/orphan.c:135: warning: format '%lu' expects type 'long unsigned int', but argument 4 has type 'ino_t' fs/ubifs/orphan.c:142: warning: format '%lu' expects type 'long unsigned int', but argument 4 has type 'ino_t' fs/ubifs/orphan.c:154: warning: format '%lu' expects type 'long unsigned int', but argument 4 has type 'ino_t' fs/ubifs/orphan.c:159: warning: format '%lu' expects type 'long unsigned int', but argument 4 has type 'ino_t' fs/ubifs/orphan.c:451: warning: format '%lu' expects type 'long unsigned int', but argument 4 has type 'ino_t' fs/ubifs/orphan.c:539: warning: format '%lu' expects type 'long unsigned int', but argument 4 has type 'ino_t' fs/ubifs/orphan.c:612: warning: format '%lu' expects type 'long unsigned int', but argument 4 has type 'ino_t' fs/ubifs/orphan.c:843: warning: format '%lu' expects type 'long unsigned int', but argument 4 has type 'ino_t' fs/ubifs/orphan.c:856: warning: format '%lu' expects type 'long unsigned int', but argument 4 has type 'ino_t' fs/ubifs/recovery.c:1438: warning: format '%lu' expects type 'long unsigned int', but argument 4 has type 'ino_t' fs/ubifs/recovery.c:1443: warning: format '%lu' expects type 'long unsigned int', but argument 4 has type 'ino_t' fs/ubifs/recovery.c:1475: warning: format '%lu' expects type 'long unsigned int', but argument 4 has type 'ino_t' fs/ubifs/recovery.c:1495: warning: format '%lu' expects type 'long unsigned int', but argument 4 has type 'ino_t' fs/ubifs/debug.c:105: warning: format '%lu' expects type 'long unsigned int', but argument 3 has type 'ino_t' fs/ubifs/debug.c:105: warning: format '%lu' expects type 'long unsigned int', but argument 3 has type 'ino_t' fs/ubifs/debug.c:110: warning: format '%lu' expects type 'long unsigned int', but argument 3 has type 'ino_t' fs/ubifs/debug.c:110: warning: format '%lu' expects type 'long unsigned int', but argument 3 has type 'ino_t' fs/ubifs/debug.c:114: warning: format '%lu' expects type 'long unsigned int', but argument 3 has type 'ino_t' fs/ubifs/debug.c:114: warning: format '%lu' expects type 'long unsigned int', but argument 3 has type 'ino_t' fs/ubifs/debug.c:118: warning: format '%lu' expects type 'long unsigned int', but argument 3 has type 'ino_t' fs/ubifs/debug.c:118: warning: format '%lu' expects type 'long unsigned int', but argument 3 has type 'ino_t' fs/ubifs/debug.c:1591: warning: format '%lu' expects type 'long unsigned int', but argument 4 has type 'ino_t' fs/ubifs/debug.c:1671: warning: format '%lu' expects type 'long unsigned int', but argument 4 has type 'ino_t' fs/ubifs/debug.c:1674: warning: format '%lu' expects type 'long unsigned int', but argument 5 has type 'ino_t' fs/ubifs/debug.c:1680: warning: format '%lu' expects type 'long unsigned int', but argument 4 has type 'ino_t' fs/ubifs/debug.c:1699: warning: format '%lu' expects type 'long unsigned int', but argument 5 has type 'ino_t' fs/ubifs/debug.c:1788: warning: format '%lu' expects type 'long unsigned int', but argument 5 has type 'ino_t' fs/ubifs/debug.c:1821: warning: format '%lu' expects type 'long unsigned int', but argument 5 has type 'ino_t' fs/ubifs/debug.c:1833: warning: format '%lu' expects type 'long unsigned int', but argument 5 has type 'ino_t' fs/ubifs/debug.c:1924: warning: format '%lu' expects type 'long unsigned int', but argument 4 has type 'ino_t' fs/ubifs/debug.c:1932: warning: format '%lu' expects type 'long unsigned int', but argument 4 has type 'ino_t' fs/ubifs/debug.c:1938: warning: format '%lu' expects type 'long unsigned int', but argument 4 has type 'ino_t' fs/ubifs/debug.c:1945: warning: format '%lu' expects type 'long unsigned int', but argument 4 has type 'ino_t' fs/ubifs/debug.c:1953: warning: format '%lu' expects type 'long unsigned int', but argument 4 has type 'ino_t' fs/ubifs/debug.c:1960: warning: format '%lu' expects type 'long unsigned int', but argument 4 has type 'ino_t' fs/ubifs/debug.c:1967: warning: format '%lu' expects type 'long unsigned int', but argument 4 has type 'ino_t' fs/ubifs/debug.c:1973: warning: format '%lu' expects type 'long unsigned int', but argument 4 has type 'ino_t' fs/ubifs/debug.c:1988: warning: format '%lu' expects type 'long unsigned int', but argument 4 has type 'ino_t' fs/ubifs/debug.c:1991: warning: format '%lu' expects type 'long unsigned int', but argument 5 has type 'ino_t' fs/ubifs/debug.c:2009: warning: format '%lu' expects type 'long unsigned int', but argument 2 has type 'ino_t'
--- fs/ubifs/debug.c | 62 +++++++++++++++++++++++++++++++--------------------- fs/ubifs/dir.c | 2 - fs/ubifs/journal.c | 6 +++-- fs/ubifs/orphan.c | 25 ++++++++++++-------- fs/ubifs/recovery.c | 11 +++++---- fs/ubifs/replay.c | 2 - fs/ubifs/tnc.c | 5 ++-- 7 files changed, 68 insertions(+), 45 deletions(-)
fs/ubifs/dir.c +1 -1
@@ -161,7 +161,7 @@ struct inode *ubifs_new_inode(struct ubireturn ERR_PTR (-EINVAL ); }ubifs_warn ("running out of inode numbers (current %lu, max %d)" , - c->highest_inum,INUM_WATERMARK ); + (unsigned long )c->highest_inum,INUM_WATERMARK ); } inode->i_ino = ++c->highest_inum;
fs/ubifs/journal.c +4 -2
@@ -690,7 +690,8 @@ int ubifs_jnl_write_data(struct ubifs_inint dlen =UBIFS_DATA_NODE_SZ +UBIFS_BLOCK_SIZE *WORST_COMPR_FACTOR ;struct ubifs_inode *ui =ubifs_inode (inode); -dbg_jnl ("ino %lu, blk %u, len %d, key %s" ,key_inum (c, key), +dbg_jnl ("ino %lu, blk %u, len %d, key %s" , + (unsigned long )key_inum (c, key),key_block (c, key), len,DBGKEY (key));ubifs_assert (len <=UBIFS_BLOCK_SIZE );
@@ -1128,7 +1129,8 @@ int ubifs_jnl_truncate(struct ubifs_infoino_t inum = inode->i_ino;unsigned int blk; -dbg_jnl ("ino %lu, size %lld -> %lld" , inum, old_size, new_size); +dbg_jnl ("ino %lu, size %lld -> %lld" , (unsigned long )inum, + old_size, new_size);ubifs_assert (!ui->data_len);ubifs_assert (S_ISREG (inode->i_mode));ubifs_assert (mutex_is_locked (&ui->ui_mutex));
fs/ubifs/replay.c +1 -1
@@ -1065,7 +1065,7 @@ int ubifs_replay_journal(struct ubifs_inubifs_assert (c->bud_bytes <= c->max_bud_bytes || c->need_recovery);dbg_mnt ("finished, log head LEB %d:%d, max_sqnum %llu, " "highest_inum %lu" , c->lhead_lnum, c->lhead_offs, c->max_sqnum, - c->highest_inum); + (unsigned long )c->highest_inum); out:destroy_replay_tree (c);destroy_bud_list (c);
fs/ubifs/tnc.c +3 -2
@@ -2677,7 +2677,7 @@ int ubifs_tnc_remove_ino(struct ubifs_instruct ubifs_dent_node *xent, *pxent =NULL ;struct qstr nm = { .name =NULL }; -dbg_tnc ("ino %lu" , inum); +dbg_tnc ("ino %lu" , (unsigned long )inum);/* * Walk all extended attribute entries and remove them together with
@@ -2697,7 +2697,8 @@ int ubifs_tnc_remove_ino(struct ubifs_in } xattr_inum =le64_to_cpu (xent->inum); -dbg_tnc ("xent '%s', ino %lu" , xent->name, xattr_inum); +dbg_tnc ("xent '%s', ino %lu" , + xent->name, (unsigned long )xattr_inum); nm.name = xent->name; nm.len =le16_to_cpu (xent->nlen);
fs/ubifs/orphan.c +15 -10
@@ -105,7 +105,7 @@ int ubifs_add_orphan(struct ubifs_info *list_add_tail (&orphan->list, &c->orph_list);list_add_tail (&orphan->new_list, &c->orph_new);spin_unlock (&c->orphan_lock); -dbg_gen ("ino %lu" , inum); +dbg_gen ("ino %lu" , (unsigned long )inum);return 0 ; }
@@ -132,14 +132,16 @@ void ubifs_delete_orphan(struct ubifs_inelse {if (o->dnext) {spin_unlock (&c->orphan_lock); -dbg_gen ("deleted twice ino %lu" , inum); +dbg_gen ("deleted twice ino %lu" , + (unsigned long )inum);return ; }if (o->cnext) { o->dnext = c->orph_dnext; c->orph_dnext = o;spin_unlock (&c->orphan_lock); -dbg_gen ("delete later ino %lu" , inum); +dbg_gen ("delete later ino %lu" , + (unsigned long )inum);return ; }rb_erase (p, &c->orph_tree);
@@ -151,12 +153,12 @@ void ubifs_delete_orphan(struct ubifs_in }spin_unlock (&c->orphan_lock);kfree (o); -dbg_gen ("inum %lu" , inum); +dbg_gen ("inum %lu" , (unsigned long )inum);return ; } }spin_unlock (&c->orphan_lock); -dbg_err ("missing orphan ino %lu" , inum); +dbg_err ("missing orphan ino %lu" , (unsigned long )inum);dbg_dump_stack (); }
@@ -448,7 +450,7 @@ static void erase_deleted(struct ubifs_irb_erase (&orphan->rb, &c->orph_tree);list_del (&orphan->list); c->tot_orphans -=1 ; -dbg_gen ("deleting orphan ino %lu" , orphan->inum); +dbg_gen ("deleting orphan ino %lu" , (unsigned long )orphan->inum);kfree (orphan); } c->orph_dnext =NULL ;
@@ -537,7 +539,7 @@ static int insert_dead_orphan(struct ubi orphan->dnext = c->orph_dnext; c->orph_dnext = orphan;dbg_mnt ("ino %lu, new %d, tot %d" , - inum, c->new_orphans, c->tot_orphans); + (unsigned long )inum, c->new_orphans, c->tot_orphans);return 0 ; }
@@ -609,7 +611,8 @@ static int do_kill_orphans(struct ubifs_ n = (le32_to_cpu (orph->ch.len) -UBIFS_ORPH_NODE_SZ ) >>3 ;for (i =0 ; i < n; i++) { inum =le64_to_cpu (orph->inos[i]); -dbg_rcvry ("deleting orphaned inode %lu" , inum); +dbg_rcvry ("deleting orphaned inode %lu" , + (unsigned long )inum); err =ubifs_tnc_remove_ino (c, inum);if (err)return err;
@@ -840,7 +843,8 @@ static int dbg_orphan_check(struct ubifsif (inum != ci->last_ino) {/* Lowest node type is the inode node, so it comes first */ if (key_type (c, &zbr->key) !=UBIFS_INO_KEY ) -ubifs_err ("found orphan node ino %lu, type %d" , inum, +ubifs_err ("found orphan node ino %lu, type %d" , + (unsigned long )inum,key_type (c, &zbr->key)); ci->last_ino = inum; ci->tot_inos +=1 ;
@@ -853,7 +857,8 @@ static int dbg_orphan_check(struct ubifs/* Must be recorded as an orphan */ if (!dbg_find_check_orphan (&ci->root, inum) && !dbg_find_orphan (c, inum)) { -ubifs_err ("missing orphan, ino %lu" , inum); +ubifs_err ("missing orphan, ino %lu" , + (unsigned long )inum); ci->missing +=1 ; } }
fs/ubifs/recovery.c +7 -4
@@ -1435,13 +1435,14 @@ static int fix_size_in_place(struct ubif err =ubi_leb_change (c->ubi, lnum, c->sbuf, len,UBI_UNKNOWN );if (err) goto out; -dbg_rcvry ("inode %lu at %d:%d size %lld -> %lld " , e->inum, lnum, offs, +dbg_rcvry ("inode %lu at %d:%d size %lld -> %lld " , + (unsigned long )e->inum, lnum, offs, i_size, e->d_size);return 0 ; out:ubifs_warn ("inode %lu failed to fix size %lld -> %lld error %d" , - e->inum, e->i_size, e->d_size, err); + (unsigned long )e->inum, e->i_size, e->d_size, err);return err; }
@@ -1472,7 +1473,8 @@ int ubifs_recover_size(struct ubifs_inforeturn err;if (err == -ENOENT ) {/* Remove data nodes that have no inode */ -dbg_rcvry ("removing ino %lu" , e->inum); +dbg_rcvry ("removing ino %lu" , + (unsigned long )e->inum); err =ubifs_tnc_remove_ino (c, e->inum);if (err)return err;
@@ -1493,7 +1495,8 @@ int ubifs_recover_size(struct ubifs_inforeturn PTR_ERR (inode);if (inode->i_size < e->d_size) {dbg_rcvry ("ino %lu size %lld -> %lld" , - e->inum, e->d_size, + (unsigned long )e->inum, + e->d_size, inode->i_size); inode->i_size = e->d_size;ubifs_inode (inode)->ui_size = e->d_size;
fs/ubifs/debug.c +37 -25
181 lines not on this page · raw message
Quoted 44 lines · Randy Dunlap
From: Randy Dunlap <[email protected]>
Fix printk format warnings in ubifs.
Built cleanly on 7 arches.
fs/ubifs/journal.c:693: warning: format '%lu' expects type 'long unsigned int', but argument 4 has type 'ino_t'fs/ubifs/journal.c:1131: warning: format '%lu' expects type 'long unsigned int', but argument 4 has type 'ino_t'fs/ubifs/dir.c:163: warning: format '%lu' expects type 'long unsigned int', but argument 4 has type 'ino_t'fs/ubifs/tnc.c:2680: warning: format '%lu' expects type 'long unsigned int', but argument 4 has type 'ino_t'fs/ubifs/tnc.c:2700: warning: format '%lu' expects type 'long unsigned int', but argument 5 has type 'ino_t'fs/ubifs/replay.c:1066: warning: format '%lu' expects type 'long unsigned int', but argument 7 has type 'ino_t'fs/ubifs/orphan.c:108: warning: format '%lu' expects type 'long unsigned int', but argument 4 has type 'ino_t'fs/ubifs/orphan.c:135: warning: format '%lu' expects type 'long unsigned int', but argument 4 has type 'ino_t'fs/ubifs/orphan.c:142: warning: format '%lu' expects type 'long unsigned int', but argument 4 has type 'ino_t'fs/ubifs/orphan.c:154: warning: format '%lu' expects type 'long unsigned int', but argument 4 has type 'ino_t'fs/ubifs/orphan.c:159: warning: format '%lu' expects type 'long unsigned int', but argument 4 has type 'ino_t'fs/ubifs/orphan.c:451: warning: format '%lu' expects type 'long unsigned int', but argument 4 has type 'ino_t'fs/ubifs/orphan.c:539: warning: format '%lu' expects type 'long unsigned int', but argument 4 has type 'ino_t'fs/ubifs/orphan.c:612: warning: format '%lu' expects type 'long unsigned int', but argument 4 has type 'ino_t'fs/ubifs/orphan.c:843: warning: format '%lu' expects type 'long unsigned int', but argument 4 has type 'ino_t'fs/ubifs/orphan.c:856: warning: format '%lu' expects type 'long unsigned int', but argument 4 has type 'ino_t'fs/ubifs/recovery.c:1438: warning: format '%lu' expects type 'long unsigned int', but argument 4 has type 'ino_t'fs/ubifs/recovery.c:1443: warning: format '%lu' expects type 'long unsigned int', but argument 4 has type 'ino_t'fs/ubifs/recovery.c:1475: warning: format '%lu' expects type 'long unsigned int', but argument 4 has type 'ino_t'fs/ubifs/recovery.c:1495: warning: format '%lu' expects type 'long unsigned int', but argument 4 has type 'ino_t'fs/ubifs/debug.c:105: warning: format '%lu' expects type 'long unsigned int', but argument 3 has type 'ino_t'fs/ubifs/debug.c:105: warning: format '%lu' expects type 'long unsigned int', but argument 3 has type 'ino_t'fs/ubifs/debug.c:110: warning: format '%lu' expects type 'long unsigned int', but argument 3 has type 'ino_t'fs/ubifs/debug.c:110: warning: format '%lu' expects type 'long unsigned int', but argument 3 has type 'ino_t'fs/ubifs/debug.c:114: warning: format '%lu' expects type 'long unsigned int', but argument 3 has type 'ino_t'fs/ubifs/debug.c:114: warning: format '%lu' expects type 'long unsigned int', but argument 3 has type 'ino_t'fs/ubifs/debug.c:118: warning: format '%lu' expects type 'long unsigned int', but argument 3 has type 'ino_t'fs/ubifs/debug.c:118: warning: format '%lu' expects type 'long unsigned int', but argument 3 has type 'ino_t'fs/ubifs/debug.c:1591: warning: format '%lu' expects type 'long unsigned int', but argument 4 has type 'ino_t'fs/ubifs/debug.c:1671: warning: format '%lu' expects type 'long unsigned int', but argument 4 has type 'ino_t'fs/ubifs/debug.c:1674: warning: format '%lu' expects type 'long unsigned int', but argument 5 has type 'ino_t'fs/ubifs/debug.c:1680: warning: format '%lu' expects type 'long unsigned int', but argument 4 has type 'ino_t'fs/ubifs/debug.c:1699: warning: format '%lu' expects type 'long unsigned int', but argument 5 has type 'ino_t'fs/ubifs/debug.c:1788: warning: format '%lu' expects type 'long unsigned int', but argument 5 has type 'ino_t'fs/ubifs/debug.c:1821: warning: format '%lu' expects type 'long unsigned int', but argument 5 has type 'ino_t'fs/ubifs/debug.c:1833: warning: format '%lu' expects type 'long unsigned int', but argument 5 has type 'ino_t'fs/ubifs/debug.c:1924: warning: format '%lu' expects type 'long unsigned int', but argument 4 has type 'ino_t'fs/ubifs/debug.c:1932: warning: format '%lu' expects type 'long unsigned int', but argument 4 has type 'ino_t'fs/ubifs/debug.c:1938: warning: format '%lu' expects type 'long unsigned int', but argument 4 has type 'ino_t'
Quoted 9 lines
fs/ubifs/debug.c:1945: warning: format '%lu' expects type 'long unsigned int', but argument 4 has type 'ino_t'fs/ubifs/debug.c:1953: warning: format '%lu' expects type 'long unsigned int', but argument 4 has type 'ino_t'fs/ubifs/debug.c:1960: warning: format '%lu' expects type 'long unsigned int', but argument 4 has type 'ino_t'fs/ubifs/debug.c:1967: warning: format '%lu' expects type 'long unsigned int', but argument 4 has type 'ino_t'fs/ubifs/debug.c:1973: warning: format '%lu' expects type 'long unsigned int', but argument 4 has type 'ino_t'fs/ubifs/debug.c:1988: warning: format '%lu' expects type 'long unsigned int', but argument 4 has type 'ino_t'fs/ubifs/debug.c:1991: warning: format '%lu' expects type 'long unsigned int', but argument 5 has type 'ino_t'fs/ubifs/debug.c:2009: warning: format '%lu' expects type 'long unsigned int', but argument 2 has type 'ino_t'
Thanks for the patch, but I've already done that after your original messages. I replied that I'll fix this, and so did I:
Signature · 2 lines
Best Regards, Artem Bityutskiy (Артём Битюцкий)