]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
ext4: hash: simplify kzalloc(n * 1, ...) to kzalloc(n, ...)
authorEthan Carter Edwards <ethan@ethancedwards.com>
Sun, 16 Mar 2025 05:33:59 +0000 (01:33 -0400)
committerTheodore Ts'o <tytso@mit.edu>
Fri, 21 Mar 2025 05:10:10 +0000 (01:10 -0400)
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>
fs/ext4/hash.c

index deabe29da7fbc3d35f674ff861a2f3b579ffdea2..33cd5b6b02d59fb749844fe481022f5f44244bb6 100644 (file)
@@ -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;