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 f587c78..c18769b 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 f09d5d5..01bcd7d 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;