]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commitdiff
ARM: s3c24xx: Simplify size used for kzalloc in iotiming get
authorMarkus Elfring <elfring@users.sourceforge.net>
Mon, 2 Oct 2017 17:16:58 +0000 (19:16 +0200)
committerKrzysztof Kozlowski <krzk@kernel.org>
Wed, 4 Oct 2017 19:09:05 +0000 (21:09 +0200)
Simplify the size argument of kzalloc() memory allocation by using
sizeof(*ptr) syntax.

This issue was detected by using the Coccinelle software.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
[krzk: Rewrite commit message]
Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
arch/arm/mach-s3c24xx/iotiming-s3c2410.c
arch/arm/mach-s3c24xx/iotiming-s3c2412.c

index f587c78fba33e8be31c613373de98a2e0a40cc33..c18769b5f15ac8ed1267e933540eb9763ddee1d9 100644 (file)
@@ -453,7 +453,7 @@ int s3c2410_iotiming_get(struct s3c_cpufreq_config *cfg,
                s3c_freq_iodbg("%s: bank %d: con %08lx\n",
                               __func__, bank, bankcon);
 
-               bt = kzalloc(sizeof(struct s3c2410_iobank_timing), GFP_KERNEL);
+               bt = kzalloc(sizeof(*bt), GFP_KERNEL);
                if (!bt)
                        return -ENOMEM;
 
index f09d5d5ea7ed3759ed6e745b6d1745e503182ed8..01bcd7d5dac7fe1540a0ed89b68598e6aeeb2554 100644 (file)
@@ -242,7 +242,7 @@ int s3c2412_iotiming_get(struct s3c_cpufreq_config *cfg,
                if (!bank_is_io(bank, bankcfg))
                        continue;
 
-               bt = kzalloc(sizeof(struct s3c2412_iobank_timing), GFP_KERNEL);
+               bt = kzalloc(sizeof(*bt), GFP_KERNEL);
                if (!bt)
                        return -ENOMEM;