Skip to content

Commit d52da5f

Browse files
maxskiiergregkh
authored andcommitted
fs: efs: remove unneeded debug prints
[ Upstream commit 8900939 ] The current code uses debug prints conditionally compiled with #ifdef DEBUG. However, that code, when compiled, causes compiler errors due to incompatible formatters and undefined variables, notably: fs/efs/file.c: In function `efs_get_block': fs/efs/file.c:26:35: error: `block' undeclared (first use in this function); did you mean `iblock'? 26 | __func__, block, inode->i_blocks, inode->i_size); | ^~~~~ and: fs/efs/file.c: In function `efs_bmap': ./include/linux/kern_levels.h:5:25: error: format `%ld' expects argument of type `long int', but argument 4 has type `blkcnt_t' {aka `long long unsigned int'} [-Werror=format=] 5 | #define KERN_SOH "\001" /* ASCII Start Of Header */ | ^~~~~~ which also extends to the other formatters. As this part of the code has been dead for just about 14 years now, it has not been modernized to stay compatible with the most recent gcc compilers. Fix these issues by removing the debug prints. Link: https://lore.kernel.org/20260605035251.89305-2-m32285159@gmail.com Fixes: f403d1d ("fs/efs: add pr_fmt / use __func__") Signed-off-by: Maxwell Doose <m32285159@gmail.com> Suggested-by: Andrew Morton <akpm@linux-foundation.org> Cc: Fabian Frederick <fabf@skynet.be> Cc: Christian Brauner <brauner@kernel.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
1 parent fc97fc8 commit d52da5f

1 file changed

Lines changed: 3 additions & 18 deletions

File tree

fs/efs/file.c

Lines changed: 3 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -18,16 +18,9 @@ int efs_get_block(struct inode *inode, sector_t iblock,
1818

1919
if (create)
2020
return error;
21-
if (iblock >= inode->i_blocks) {
22-
#ifdef DEBUG
23-
/*
24-
* i have no idea why this happens as often as it does
25-
*/
26-
pr_warn("%s(): block %d >= %ld (filesize %ld)\n",
27-
__func__, block, inode->i_blocks, inode->i_size);
28-
#endif
21+
if (iblock >= inode->i_blocks)
2922
return 0;
30-
}
23+
3124
phys = efs_map_block(inode, iblock);
3225
if (phys)
3326
map_bh(bh_result, inode->i_sb, phys);
@@ -42,16 +35,8 @@ int efs_bmap(struct inode *inode, efs_block_t block) {
4235
}
4336

4437
/* are we about to read past the end of a file ? */
45-
if (!(block < inode->i_blocks)) {
46-
#ifdef DEBUG
47-
/*
48-
* i have no idea why this happens as often as it does
49-
*/
50-
pr_warn("%s(): block %d >= %ld (filesize %ld)\n",
51-
__func__, block, inode->i_blocks, inode->i_size);
52-
#endif
38+
if (!(block < inode->i_blocks))
5339
return 0;
54-
}
5540

5641
return efs_map_block(inode, block);
5742
}

0 commit comments

Comments
 (0)