[PATCH] mm/shmem: drop redundant casts in shmem_evict_inode() pr_warn
From: Jiacheng Yu
Date: Wed Jul 29 2026 - 07:52:38 EST
blkcnt_t and i_ino are u64, %llu matches both directly, so drop the casts.
Signed-off-by: Jiacheng Yu <yujiacheng3@xxxxxxxxxx>
---
On Tue, 28 Jul 2026 Andrew Morton wrote:
> I don't think the i_ino cast is needed?
>
> blkcnt_t was possibly 32-bit a long time ago but
> afaict it's now unconditionally u64.
yes -- i_ino is u64 since 0b2600f81cef ("treewide: change inode->i_ino
from unsigned long to u64"), and blkcnt_t is unconditionally u64,
so both casts can go.
mm/shmem.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/mm/shmem.c b/mm/shmem.c
index 223484cdc8f2..96cf73c906df 100644
--- a/mm/shmem.c
+++ b/mm/shmem.c
@@ -1430,8 +1430,7 @@ static void shmem_evict_inode(struct inode *inode)
shmem_free_inode(inode->i_sb, freed);
if (inode->i_blocks)
pr_warn("%s: ino=%llu i_blocks=%llu alloced=%lu swapped=%lu nrpages=%lu\n",
- __func__, (unsigned long long)inode->i_ino,
- (unsigned long long)inode->i_blocks,
+ __func__, inode->i_ino, inode->i_blocks,
info->alloced, info->swapped, inode->i_mapping->nrpages);
clear_inode(inode);
#ifdef CONFIG_TMPFS_QUOTA
--
2.34.1