Skip to content

Commit 1e93d6f

Browse files
ethancedwards8tytso
authored andcommitted
ext4: hash: simplify kzalloc(n * 1, ...) to kzalloc(n, ...)
sizeof(char) evaluates to 1. Remove the churn. Signed-off-by: Ethan Carter Edwards <ethan@ethancedwards.com> Reviewed-by: Andreas Dilger <adilger@dilger.ca> Link: https://patch.msgid.link/20250316-ext4-hash-kcalloc-v2-1-2a99e93ec6e0@ethancedwards.com Signed-off-by: Theodore Ts'o <tytso@mit.edu>
1 parent aac4507 commit 1e93d6f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

fs/ext4/hash.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -302,7 +302,7 @@ int ext4fs_dirhash(const struct inode *dir, const char *name, int len,
302302

303303
if (len && IS_CASEFOLDED(dir) &&
304304
(!IS_ENCRYPTED(dir) || fscrypt_has_encryption_key(dir))) {
305-
buff = kzalloc(sizeof(char) * PATH_MAX, GFP_KERNEL);
305+
buff = kzalloc(PATH_MAX, GFP_KERNEL);
306306
if (!buff)
307307
return -ENOMEM;
308308

0 commit comments

Comments
 (0)