1 ext4 extents: remove unneeded casts
3 From: Eric Sandeen <sandeen@redhat.com>
5 There are many casts in extents.c which are not needed,
6 as the variables are already the type of the cast, or
7 are being promoted for no particular reason in printk's.
9 Signed-off-by: Eric Sandeen <sandeen@redhat.com>
10 Signed-off-by: Mingming Cao <cmm@us.ibm.com>
13 fs/ext4/extents.c | 49 ++++++++++++++++++++++---------------------------
14 1 file changed, 22 insertions(+), 27 deletions(-)
17 Index: linux-2.6.24-rc7/fs/ext4/extents.c
18 ===================================================================
19 --- linux-2.6.24-rc7.orig/fs/ext4/extents.c 2008-01-16 13:48:31.000000000 -0800
20 +++ linux-2.6.24-rc7/fs/ext4/extents.c 2008-01-16 13:48:46.000000000 -0800
21 @@ -374,7 +374,7 @@ ext4_ext_binsearch_idx(struct inode *ino
22 struct ext4_extent_idx *r, *l, *m;
25 - ext_debug("binsearch for %lu(idx): ", (unsigned long)block);
26 + ext_debug("binsearch for %u(idx): ", block);
28 l = EXT_FIRST_INDEX(eh) + 1;
29 r = EXT_LAST_INDEX(eh);
30 @@ -440,7 +440,7 @@ ext4_ext_binsearch(struct inode *inode,
34 - ext_debug("binsearch for %lu: ", (unsigned long)block);
35 + ext_debug("binsearch for %u: ", block);
37 l = EXT_FIRST_EXTENT(eh) + 1;
38 r = EXT_LAST_EXTENT(eh);
39 @@ -766,7 +766,7 @@ static int ext4_ext_split(handle_t *hand
42 newblock = ablocks[--a];
43 - bh = sb_getblk(inode->i_sb, (ext4_fsblk_t)newblock);
44 + bh = sb_getblk(inode->i_sb, newblock);
48 @@ -786,9 +786,8 @@ static int ext4_ext_split(handle_t *hand
49 fidx->ei_block = border;
50 ext4_idx_store_pblock(fidx, oldblock);
52 - ext_debug("int.index at %d (block %llu): %lu -> %llu\n", i,
53 - newblock, (unsigned long) le32_to_cpu(border),
55 + ext_debug("int.index at %d (block %llu): %u -> %llu\n",
56 + i, newblock, le32_to_cpu(border), oldblock);
60 @@ -1476,10 +1475,10 @@ ext4_ext_put_gap_in_cache(struct inode *
61 } else if (block < le32_to_cpu(ex->ee_block)) {
63 len = le32_to_cpu(ex->ee_block) - block;
64 - ext_debug("cache gap(before): %lu [%lu:%lu]",
65 - (unsigned long) block,
66 - (unsigned long) le32_to_cpu(ex->ee_block),
67 - (unsigned long) ext4_ext_get_actual_len(ex));
68 + ext_debug("cache gap(before): %u [%u:%u]",
70 + le32_to_cpu(ex->ee_block),
71 + ext4_ext_get_actual_len(ex));
72 } else if (block >= le32_to_cpu(ex->ee_block)
73 + ext4_ext_get_actual_len(ex)) {
75 @@ -1487,10 +1486,10 @@ ext4_ext_put_gap_in_cache(struct inode *
76 + ext4_ext_get_actual_len(ex);
78 next = ext4_ext_next_allocated_block(path);
79 - ext_debug("cache gap(after): [%lu:%lu] %lu",
80 - (unsigned long) le32_to_cpu(ex->ee_block),
81 - (unsigned long) ext4_ext_get_actual_len(ex),
82 - (unsigned long) block);
83 + ext_debug("cache gap(after): [%u:%u] %u",
84 + le32_to_cpu(ex->ee_block),
85 + ext4_ext_get_actual_len(ex),
87 BUG_ON(next == lblock);
90 @@ -1498,7 +1497,7 @@ ext4_ext_put_gap_in_cache(struct inode *
94 - ext_debug(" -> %lu:%lu\n", (unsigned long) lblock, len);
95 + ext_debug(" -> %u:%lu\n", lblock, len);
96 ext4_ext_put_in_cache(inode, lblock, len, 0, EXT4_EXT_CACHE_GAP);
99 @@ -1520,11 +1519,9 @@ ext4_ext_in_cache(struct inode *inode, e
100 ex->ee_block = cpu_to_le32(cex->ec_block);
101 ext4_ext_store_pblock(ex, cex->ec_start);
102 ex->ee_len = cpu_to_le16(cex->ec_len);
103 - ext_debug("%lu cached by %lu:%lu:%llu\n",
104 - (unsigned long) block,
105 - (unsigned long) cex->ec_block,
106 - (unsigned long) cex->ec_len,
108 + ext_debug("%u cached by %u:%u:%llu\n",
110 + cex->ec_block, cex->ec_len, cex->ec_start);
114 @@ -2145,9 +2142,8 @@ int ext4_ext_get_blocks(handle_t *handle
115 unsigned long allocated = 0;
117 __clear_bit(BH_New, &bh_result->b_state);
118 - ext_debug("blocks %lu/%lu requested for inode %u\n",
119 - (unsigned long) iblock, max_blocks,
120 - (unsigned) inode->i_ino);
121 + ext_debug("blocks %u/%lu requested for inode %u\n",
122 + iblock, max_blocks, inode->i_ino);
123 mutex_lock(&EXT4_I(inode)->truncate_mutex);
126 @@ -2210,7 +2206,7 @@ int ext4_ext_get_blocks(handle_t *handle
127 newblock = iblock - ee_block + ee_start;
128 /* number of remaining blocks in the extent */
129 allocated = ee_len - (iblock - ee_block);
130 - ext_debug("%d fit into %lu:%d -> %llu\n", (int) iblock,
131 + ext_debug("%u fit into %lu:%d -> %llu\n", iblock,
132 ee_block, ee_len, newblock);
134 /* Do not put uninitialized extent in the cache */
135 @@ -2470,9 +2466,8 @@ retry:
137 ext4_error(inode->i_sb, "ext4_fallocate",
138 "ext4_ext_get_blocks returned 0! inode#%lu"
139 - ", block=%lu, max_blocks=%lu",
140 - inode->i_ino, (unsigned long)block,
141 - (unsigned long)max_blocks);
142 + ", block=%u, max_blocks=%lu",
143 + inode->i_ino, block, max_blocks);
145 ext4_mark_inode_dirty(handle, inode);
146 ret2 = ext4_journal_stop(handle);