From: Ethan Carter Edwards Date: Sun, 16 Mar 2025 05:33:59 +0000 (-0400) Subject: ext4: hash: simplify kzalloc(n * 1, ...) to kzalloc(n, ...) X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=1e93d6f221e7cfe5e069583a2b664e79eb361ba6;p=users%2Fwilly%2Fxarray.git 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 --- 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;