UBIFS: fix compilation warnings

We print 'ino_t' type using '%lu' printk() placeholder, but this
results in many warnings when compiling for Alpha platform. Fix
this by adding (unsingned long) casts.

Fixes these warnings:

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'

Reported-by: Randy Dunlap <randy.dunlap@oracle.com>
Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>

+70 -50
+37 -25
fs/ubifs/debug.c
··· 101 101 if (c->key_fmt == UBIFS_SIMPLE_KEY_FMT) { 102 102 switch (type) { 103 103 case UBIFS_INO_KEY: 104 - sprintf(p, "(%lu, %s)", key_inum(c, key), 104 + sprintf(p, "(%lu, %s)", (unsigned long)key_inum(c, key), 105 105 get_key_type(type)); 106 106 break; 107 107 case UBIFS_DENT_KEY: 108 108 case UBIFS_XENT_KEY: 109 - sprintf(p, "(%lu, %s, %#08x)", key_inum(c, key), 109 + sprintf(p, "(%lu, %s, %#08x)", 110 + (unsigned long)key_inum(c, key), 110 111 get_key_type(type), key_hash(c, key)); 111 112 break; 112 113 case UBIFS_DATA_KEY: 113 - sprintf(p, "(%lu, %s, %u)", key_inum(c, key), 114 + sprintf(p, "(%lu, %s, %u)", 115 + (unsigned long)key_inum(c, key), 114 116 get_key_type(type), key_block(c, key)); 115 117 break; 116 118 case UBIFS_TRUN_KEY: 117 119 sprintf(p, "(%lu, %s)", 118 - key_inum(c, key), get_key_type(type)); 120 + (unsigned long)key_inum(c, key), 121 + get_key_type(type)); 119 122 break; 120 123 default: 121 124 sprintf(p, "(bad key type: %#08x, %#08x)", ··· 1592 1589 1593 1590 if (inum > c->highest_inum) { 1594 1591 ubifs_err("too high inode number, max. is %lu", 1595 - c->highest_inum); 1592 + (unsigned long)c->highest_inum); 1596 1593 return ERR_PTR(-EINVAL); 1597 1594 } 1598 1595 ··· 1671 1668 ino_key_init(c, &key, inum); 1672 1669 err = ubifs_lookup_level0(c, &key, &znode, &n); 1673 1670 if (!err) { 1674 - ubifs_err("inode %lu not found in index", inum); 1671 + ubifs_err("inode %lu not found in index", (unsigned long)inum); 1675 1672 return ERR_PTR(-ENOENT); 1676 1673 } else if (err < 0) { 1677 - ubifs_err("error %d while looking up inode %lu", err, inum); 1674 + ubifs_err("error %d while looking up inode %lu", 1675 + err, (unsigned long)inum); 1678 1676 return ERR_PTR(err); 1679 1677 } 1680 1678 1681 1679 zbr = &znode->zbranch[n]; 1682 1680 if (zbr->len < UBIFS_INO_NODE_SZ) { 1683 - ubifs_err("bad node %lu node length %d", inum, zbr->len); 1681 + ubifs_err("bad node %lu node length %d", 1682 + (unsigned long)inum, zbr->len); 1684 1683 return ERR_PTR(-EINVAL); 1685 1684 } 1686 1685 ··· 1702 1697 kfree(ino); 1703 1698 if (IS_ERR(fscki)) { 1704 1699 ubifs_err("error %ld while adding inode %lu node", 1705 - PTR_ERR(fscki), inum); 1700 + PTR_ERR(fscki), (unsigned long)inum); 1706 1701 return fscki; 1707 1702 } 1708 1703 ··· 1791 1786 if (IS_ERR(fscki)) { 1792 1787 err = PTR_ERR(fscki); 1793 1788 ubifs_err("error %d while processing data node and " 1794 - "trying to find inode node %lu", err, inum); 1789 + "trying to find inode node %lu", 1790 + err, (unsigned long)inum); 1795 1791 goto out_dump; 1796 1792 } 1797 1793 ··· 1825 1819 if (IS_ERR(fscki)) { 1826 1820 err = PTR_ERR(fscki); 1827 1821 ubifs_err("error %d while processing entry node and " 1828 - "trying to find inode node %lu", err, inum); 1822 + "trying to find inode node %lu", 1823 + err, (unsigned long)inum); 1829 1824 goto out_dump; 1830 1825 } 1831 1826 ··· 1839 1832 err = PTR_ERR(fscki); 1840 1833 ubifs_err("error %d while processing entry node and " 1841 1834 "trying to find parent inode node %lu", 1842 - err, inum); 1835 + err, (unsigned long)inum); 1843 1836 goto out_dump; 1844 1837 } 1845 1838 ··· 1930 1923 fscki->references != 1) { 1931 1924 ubifs_err("directory inode %lu has %d " 1932 1925 "direntries which refer it, but " 1933 - "should be 1", fscki->inum, 1926 + "should be 1", 1927 + (unsigned long)fscki->inum, 1934 1928 fscki->references); 1935 1929 goto out_dump; 1936 1930 } ··· 1939 1931 fscki->references != 0) { 1940 1932 ubifs_err("root inode %lu has non-zero (%d) " 1941 1933 "direntries which refer it", 1942 - fscki->inum, fscki->references); 1934 + (unsigned long)fscki->inum, 1935 + fscki->references); 1943 1936 goto out_dump; 1944 1937 } 1945 1938 if (fscki->calc_sz != fscki->size) { 1946 1939 ubifs_err("directory inode %lu size is %lld, " 1947 1940 "but calculated size is %lld", 1948 - fscki->inum, fscki->size, 1949 - fscki->calc_sz); 1941 + (unsigned long)fscki->inum, 1942 + fscki->size, fscki->calc_sz); 1950 1943 goto out_dump; 1951 1944 } 1952 1945 if (fscki->calc_cnt != fscki->nlink) { 1953 1946 ubifs_err("directory inode %lu nlink is %d, " 1954 1947 "but calculated nlink is %d", 1955 - fscki->inum, fscki->nlink, 1956 - fscki->calc_cnt); 1948 + (unsigned long)fscki->inum, 1949 + fscki->nlink, fscki->calc_cnt); 1957 1950 goto out_dump; 1958 1951 } 1959 1952 } else { 1960 1953 if (fscki->references != fscki->nlink) { 1961 1954 ubifs_err("inode %lu nlink is %d, but " 1962 - "calculated nlink is %d", fscki->inum, 1955 + "calculated nlink is %d", 1956 + (unsigned long)fscki->inum, 1963 1957 fscki->nlink, fscki->references); 1964 1958 goto out_dump; 1965 1959 } ··· 1969 1959 if (fscki->xattr_sz != fscki->calc_xsz) { 1970 1960 ubifs_err("inode %lu has xattr size %u, but " 1971 1961 "calculated size is %lld", 1972 - fscki->inum, fscki->xattr_sz, 1962 + (unsigned long)fscki->inum, fscki->xattr_sz, 1973 1963 fscki->calc_xsz); 1974 1964 goto out_dump; 1975 1965 } 1976 1966 if (fscki->xattr_cnt != fscki->calc_xcnt) { 1977 1967 ubifs_err("inode %lu has %u xattrs, but " 1978 - "calculated count is %lld", fscki->inum, 1968 + "calculated count is %lld", 1969 + (unsigned long)fscki->inum, 1979 1970 fscki->xattr_cnt, fscki->calc_xcnt); 1980 1971 goto out_dump; 1981 1972 } 1982 1973 if (fscki->xattr_nms != fscki->calc_xnms) { 1983 1974 ubifs_err("inode %lu has xattr names' size %u, but " 1984 1975 "calculated names' size is %lld", 1985 - fscki->inum, fscki->xattr_nms, 1976 + (unsigned long)fscki->inum, fscki->xattr_nms, 1986 1977 fscki->calc_xnms); 1987 1978 goto out_dump; 1988 1979 } ··· 1996 1985 ino_key_init(c, &key, fscki->inum); 1997 1986 err = ubifs_lookup_level0(c, &key, &znode, &n); 1998 1987 if (!err) { 1999 - ubifs_err("inode %lu not found in index", fscki->inum); 1988 + ubifs_err("inode %lu not found in index", 1989 + (unsigned long)fscki->inum); 2000 1990 return -ENOENT; 2001 1991 } else if (err < 0) { 2002 1992 ubifs_err("error %d while looking up inode %lu", 2003 - err, fscki->inum); 1993 + err, (unsigned long)fscki->inum); 2004 1994 return err; 2005 1995 } 2006 1996 ··· 2019 2007 } 2020 2008 2021 2009 ubifs_msg("dump of the inode %lu sitting in LEB %d:%d", 2022 - fscki->inum, zbr->lnum, zbr->offs); 2010 + (unsigned long)fscki->inum, zbr->lnum, zbr->offs); 2023 2011 dbg_dump_node(c, ino); 2024 2012 kfree(ino); 2025 2013 return -EINVAL;
+1 -1
fs/ubifs/dir.c
··· 161 161 return ERR_PTR(-EINVAL); 162 162 } 163 163 ubifs_warn("running out of inode numbers (current %lu, max %d)", 164 - c->highest_inum, INUM_WATERMARK); 164 + (unsigned long)c->highest_inum, INUM_WATERMARK); 165 165 } 166 166 167 167 inode->i_ino = ++c->highest_inum;
+5 -3
fs/ubifs/journal.c
··· 690 690 int dlen = UBIFS_DATA_NODE_SZ + UBIFS_BLOCK_SIZE * WORST_COMPR_FACTOR; 691 691 struct ubifs_inode *ui = ubifs_inode(inode); 692 692 693 - dbg_jnl("ino %lu, blk %u, len %d, key %s", key_inum(c, key), 694 - key_block(c, key), len, DBGKEY(key)); 693 + dbg_jnl("ino %lu, blk %u, len %d, key %s", 694 + (unsigned long)key_inum(c, key), key_block(c, key), len, 695 + DBGKEY(key)); 695 696 ubifs_assert(len <= UBIFS_BLOCK_SIZE); 696 697 697 698 data = kmalloc(dlen, GFP_NOFS); ··· 1129 1128 ino_t inum = inode->i_ino; 1130 1129 unsigned int blk; 1131 1130 1132 - dbg_jnl("ino %lu, size %lld -> %lld", inum, old_size, new_size); 1131 + dbg_jnl("ino %lu, size %lld -> %lld", 1132 + (unsigned long)inum, old_size, new_size); 1133 1133 ubifs_assert(!ui->data_len); 1134 1134 ubifs_assert(S_ISREG(inode->i_mode)); 1135 1135 ubifs_assert(mutex_is_locked(&ui->ui_mutex));
+16 -12
fs/ubifs/orphan.c
··· 105 105 list_add_tail(&orphan->list, &c->orph_list); 106 106 list_add_tail(&orphan->new_list, &c->orph_new); 107 107 spin_unlock(&c->orphan_lock); 108 - dbg_gen("ino %lu", inum); 108 + dbg_gen("ino %lu", (unsigned long)inum); 109 109 return 0; 110 110 } 111 111 ··· 132 132 else { 133 133 if (o->dnext) { 134 134 spin_unlock(&c->orphan_lock); 135 - dbg_gen("deleted twice ino %lu", inum); 135 + dbg_gen("deleted twice ino %lu", 136 + (unsigned long)inum); 136 137 return; 137 138 } 138 139 if (o->cnext) { 139 140 o->dnext = c->orph_dnext; 140 141 c->orph_dnext = o; 141 142 spin_unlock(&c->orphan_lock); 142 - dbg_gen("delete later ino %lu", inum); 143 + dbg_gen("delete later ino %lu", 144 + (unsigned long)inum); 143 145 return; 144 146 } 145 147 rb_erase(p, &c->orph_tree); ··· 153 151 } 154 152 spin_unlock(&c->orphan_lock); 155 153 kfree(o); 156 - dbg_gen("inum %lu", inum); 154 + dbg_gen("inum %lu", (unsigned long)inum); 157 155 return; 158 156 } 159 157 } 160 158 spin_unlock(&c->orphan_lock); 161 - dbg_err("missing orphan ino %lu", inum); 159 + dbg_err("missing orphan ino %lu", (unsigned long)inum); 162 160 dbg_dump_stack(); 163 161 } 164 162 ··· 450 448 rb_erase(&orphan->rb, &c->orph_tree); 451 449 list_del(&orphan->list); 452 450 c->tot_orphans -= 1; 453 - dbg_gen("deleting orphan ino %lu", orphan->inum); 451 + dbg_gen("deleting orphan ino %lu", (unsigned long)orphan->inum); 454 452 kfree(orphan); 455 453 } 456 454 c->orph_dnext = NULL; ··· 538 536 list_add_tail(&orphan->list, &c->orph_list); 539 537 orphan->dnext = c->orph_dnext; 540 538 c->orph_dnext = orphan; 541 - dbg_mnt("ino %lu, new %d, tot %d", 542 - inum, c->new_orphans, c->tot_orphans); 539 + dbg_mnt("ino %lu, new %d, tot %d", (unsigned long)inum, 540 + c->new_orphans, c->tot_orphans); 543 541 return 0; 544 542 } 545 543 ··· 611 609 n = (le32_to_cpu(orph->ch.len) - UBIFS_ORPH_NODE_SZ) >> 3; 612 610 for (i = 0; i < n; i++) { 613 611 inum = le64_to_cpu(orph->inos[i]); 614 - dbg_rcvry("deleting orphaned inode %lu", inum); 612 + dbg_rcvry("deleting orphaned inode %lu", 613 + (unsigned long)inum); 615 614 err = ubifs_tnc_remove_ino(c, inum); 616 615 if (err) 617 616 return err; ··· 843 840 if (inum != ci->last_ino) { 844 841 /* Lowest node type is the inode node, so it comes first */ 845 842 if (key_type(c, &zbr->key) != UBIFS_INO_KEY) 846 - ubifs_err("found orphan node ino %lu, type %d", inum, 847 - key_type(c, &zbr->key)); 843 + ubifs_err("found orphan node ino %lu, type %d", 844 + (unsigned long)inum, key_type(c, &zbr->key)); 848 845 ci->last_ino = inum; 849 846 ci->tot_inos += 1; 850 847 err = ubifs_tnc_read_node(c, zbr, ci->node); ··· 856 853 /* Must be recorded as an orphan */ 857 854 if (!dbg_find_check_orphan(&ci->root, inum) && 858 855 !dbg_find_orphan(c, inum)) { 859 - ubifs_err("missing orphan, ino %lu", inum); 856 + ubifs_err("missing orphan, ino %lu", 857 + (unsigned long)inum); 860 858 ci->missing += 1; 861 859 } 862 860 }
+7 -6
fs/ubifs/recovery.c
··· 1435 1435 err = ubi_leb_change(c->ubi, lnum, c->sbuf, len, UBI_UNKNOWN); 1436 1436 if (err) 1437 1437 goto out; 1438 - dbg_rcvry("inode %lu at %d:%d size %lld -> %lld ", e->inum, lnum, offs, 1439 - i_size, e->d_size); 1438 + dbg_rcvry("inode %lu at %d:%d size %lld -> %lld ", 1439 + (unsigned long)e->inum, lnum, offs, i_size, e->d_size); 1440 1440 return 0; 1441 1441 1442 1442 out: 1443 1443 ubifs_warn("inode %lu failed to fix size %lld -> %lld error %d", 1444 - e->inum, e->i_size, e->d_size, err); 1444 + (unsigned long)e->inum, e->i_size, e->d_size, err); 1445 1445 return err; 1446 1446 } 1447 1447 ··· 1472 1472 return err; 1473 1473 if (err == -ENOENT) { 1474 1474 /* Remove data nodes that have no inode */ 1475 - dbg_rcvry("removing ino %lu", e->inum); 1475 + dbg_rcvry("removing ino %lu", 1476 + (unsigned long)e->inum); 1476 1477 err = ubifs_tnc_remove_ino(c, e->inum); 1477 1478 if (err) 1478 1479 return err; ··· 1494 1493 return PTR_ERR(inode); 1495 1494 if (inode->i_size < e->d_size) { 1496 1495 dbg_rcvry("ino %lu size %lld -> %lld", 1497 - e->inum, e->d_size, 1498 - inode->i_size); 1496 + (unsigned long)e->inum, 1497 + e->d_size, inode->i_size); 1499 1498 inode->i_size = e->d_size; 1500 1499 ubifs_inode(inode)->ui_size = e->d_size; 1501 1500 e->inode = inode;
+1 -1
fs/ubifs/replay.c
··· 1065 1065 ubifs_assert(c->bud_bytes <= c->max_bud_bytes || c->need_recovery); 1066 1066 dbg_mnt("finished, log head LEB %d:%d, max_sqnum %llu, " 1067 1067 "highest_inum %lu", c->lhead_lnum, c->lhead_offs, c->max_sqnum, 1068 - c->highest_inum); 1068 + (unsigned long)c->highest_inum); 1069 1069 out: 1070 1070 destroy_replay_tree(c); 1071 1071 destroy_bud_list(c);
+3 -2
fs/ubifs/tnc.c
··· 2677 2677 struct ubifs_dent_node *xent, *pxent = NULL; 2678 2678 struct qstr nm = { .name = NULL }; 2679 2679 2680 - dbg_tnc("ino %lu", inum); 2680 + dbg_tnc("ino %lu", (unsigned long)inum); 2681 2681 2682 2682 /* 2683 2683 * Walk all extended attribute entries and remove them together with ··· 2697 2697 } 2698 2698 2699 2699 xattr_inum = le64_to_cpu(xent->inum); 2700 - dbg_tnc("xent '%s', ino %lu", xent->name, xattr_inum); 2700 + dbg_tnc("xent '%s', ino %lu", xent->name, 2701 + (unsigned long)xattr_inum); 2701 2702 2702 2703 nm.name = xent->name; 2703 2704 nm.len = le16_to_cpu(xent->nlen);