dm: change kzalloc to kcalloc
authorEthan Carter Edwards <ethan@ethancedwards.com>
Tue, 24 Dec 2024 22:13:21 +0000 (22:13 +0000)
committerMikulas Patocka <mpatocka@redhat.com>
Fri, 17 Jan 2025 21:05:39 +0000 (22:05 +0100)
Use 2-factor multiplication argument form kcalloc() instead
of instead of the deprecated kzalloc() [1].

[1] https://www.kernel.org/doc/html/next/process/deprecated.html#open-coded-arithmetic-in-allocator-arguments
Link: https://github.com/KSPP/linux/issues/162
Signed-off-by: Ethan Carter Edwards <ethan@ethancedwards.com>
Reviewed-by: Gustavo A. R. Silva <gustavoars@kernel.org>
Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
drivers/md/dm-ps-io-affinity.c

index 461ee6b2044dedab69aa85b6e319e3624a426cec..716807e511ee88a6841ea4c64a58e6fc2505678b 100644 (file)
@@ -116,7 +116,7 @@ static int ioa_create(struct path_selector *ps, unsigned int argc, char **argv)
        if (!s)
                return -ENOMEM;
 
-       s->path_map = kzalloc(nr_cpu_ids * sizeof(struct path_info *),
+       s->path_map = kcalloc(nr_cpu_ids, sizeof(struct path_info *),
                              GFP_KERNEL);
        if (!s->path_map)
                goto free_selector;