From 1e93d6f221e7cfe5e069583a2b664e79eb361ba6 Mon Sep 17 00:00:00 2001 From: Ethan Carter Edwards Date: Sun, 16 Mar 2025 01:33:59 -0400 Subject: [PATCH] ext4: hash: simplify kzalloc(n * 1, ...) to kzalloc(n, ...) sizeof(char) evaluates to 1. Remove the churn. Signed-off-by: Ethan Carter Edwards Reviewed-by: Andreas Dilger Link: https://patch.msgid.link/20250316-ext4-hash-kcalloc-v2-1-2a99e93ec6e0@ethancedwards.com Signed-off-by: Theodore Ts'o --- fs/ext4/hash.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/ext4/hash.c b/fs/ext4/hash.c index deabe29da7fb..33cd5b6b02d5 100644 --- a/fs/ext4/hash.c +++ b/fs/ext4/hash.c @@ -302,7 +302,7 @@ int ext4fs_dirhash(const struct inode *dir, const char *name, int len, if (len && IS_CASEFOLDED(dir) && (!IS_ENCRYPTED(dir) || fscrypt_has_encryption_key(dir))) { - buff = kzalloc(sizeof(char) * PATH_MAX, GFP_KERNEL); + buff = kzalloc(PATH_MAX, GFP_KERNEL); if (!buff) return -ENOMEM; -- 2.50.1