From b3b391f8e49cf71d70a95a55ad0808e1fdf3e130 Mon Sep 17 00:00:00 2001 From: Markus Elfring Date: Mon, 2 Oct 2017 19:14:20 +0200 Subject: ARM: s3c24xx: Remove printk for failed memory allocation in iotiming get Omit an extra message for a memory allocation failure in s3c2410_iotiming_get() and s3c2412_iotiming_get(). This issue was detected by using the Coccinelle software. Signed-off-by: Markus Elfring Signed-off-by: Krzysztof Kozlowski --- arch/arm/mach-s3c24xx/iotiming-s3c2410.c | 4 +--- arch/arm/mach-s3c24xx/iotiming-s3c2412.c | 4 +--- 2 files changed, 2 insertions(+), 6 deletions(-) (limited to 'arch/arm/mach-s3c24xx') diff --git a/arch/arm/mach-s3c24xx/iotiming-s3c2410.c b/arch/arm/mach-s3c24xx/iotiming-s3c2410.c index b7970f1fa3d5..f587c78fba33 100644 --- a/arch/arm/mach-s3c24xx/iotiming-s3c2410.c +++ b/arch/arm/mach-s3c24xx/iotiming-s3c2410.c @@ -454,10 +454,8 @@ int s3c2410_iotiming_get(struct s3c_cpufreq_config *cfg, __func__, bank, bankcon); bt = kzalloc(sizeof(struct s3c2410_iobank_timing), GFP_KERNEL); - if (!bt) { - printk(KERN_ERR "%s: no memory for bank\n", __func__); + if (!bt) return -ENOMEM; - } /* find out in nWait is enabled for bank. */ diff --git a/arch/arm/mach-s3c24xx/iotiming-s3c2412.c b/arch/arm/mach-s3c24xx/iotiming-s3c2412.c index 28b13951de87..f09d5d5ea7ed 100644 --- a/arch/arm/mach-s3c24xx/iotiming-s3c2412.c +++ b/arch/arm/mach-s3c24xx/iotiming-s3c2412.c @@ -243,10 +243,8 @@ int s3c2412_iotiming_get(struct s3c_cpufreq_config *cfg, continue; bt = kzalloc(sizeof(struct s3c2412_iobank_timing), GFP_KERNEL); - if (!bt) { - printk(KERN_ERR "%s: no memory for bank\n", __func__); + if (!bt) return -ENOMEM; - } timings->bank[bank].io_2412 = bt; s3c2412_iotiming_getbank(cfg, bt, bank); -- cgit v1.2.3-59-g8ed1b From 637a75207087b4e862e0b5016547dbf8753b4346 Mon Sep 17 00:00:00 2001 From: Markus Elfring Date: Mon, 2 Oct 2017 19:16:58 +0200 Subject: ARM: s3c24xx: Simplify size used for kzalloc in iotiming get 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 [krzk: Rewrite commit message] Signed-off-by: Krzysztof Kozlowski --- arch/arm/mach-s3c24xx/iotiming-s3c2410.c | 2 +- arch/arm/mach-s3c24xx/iotiming-s3c2412.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'arch/arm/mach-s3c24xx') diff --git a/arch/arm/mach-s3c24xx/iotiming-s3c2410.c b/arch/arm/mach-s3c24xx/iotiming-s3c2410.c index f587c78fba33..c18769b5f15a 100644 --- a/arch/arm/mach-s3c24xx/iotiming-s3c2410.c +++ b/arch/arm/mach-s3c24xx/iotiming-s3c2410.c @@ -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; diff --git a/arch/arm/mach-s3c24xx/iotiming-s3c2412.c b/arch/arm/mach-s3c24xx/iotiming-s3c2412.c index f09d5d5ea7ed..01bcd7d5dac7 100644 --- a/arch/arm/mach-s3c24xx/iotiming-s3c2412.c +++ b/arch/arm/mach-s3c24xx/iotiming-s3c2412.c @@ -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; -- cgit v1.2.3-59-g8ed1b From 6c7a7db2e4c25acf8bd8086797d39a51728139e0 Mon Sep 17 00:00:00 2001 From: Markus Elfring Date: Mon, 2 Oct 2017 19:34:36 +0200 Subject: ARM: s3c2410: Fix typos in a comments Fix "infromation" language typo. Signed-off-by: Markus Elfring [krzk: Rewrite commit message] Signed-off-by: Krzysztof Kozlowski --- arch/arm/mach-s3c24xx/iotiming-s3c2410.c | 2 +- arch/arm/mach-s3c24xx/iotiming-s3c2412.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'arch/arm/mach-s3c24xx') diff --git a/arch/arm/mach-s3c24xx/iotiming-s3c2410.c b/arch/arm/mach-s3c24xx/iotiming-s3c2410.c index c18769b5f15a..d5f1f06e4811 100644 --- a/arch/arm/mach-s3c24xx/iotiming-s3c2410.c +++ b/arch/arm/mach-s3c24xx/iotiming-s3c2410.c @@ -206,7 +206,7 @@ static int calc_tacc(unsigned int cyc, int nwait_en, } /** - * s3c2410_calc_bank - calculate bank timing infromation + * s3c2410_calc_bank - calculate bank timing information * @cfg: The configuration we need to calculate for. * @bt: The bank timing information. * diff --git a/arch/arm/mach-s3c24xx/iotiming-s3c2412.c b/arch/arm/mach-s3c24xx/iotiming-s3c2412.c index 01bcd7d5dac7..c5b12f6b02b5 100644 --- a/arch/arm/mach-s3c24xx/iotiming-s3c2412.c +++ b/arch/arm/mach-s3c24xx/iotiming-s3c2412.c @@ -35,7 +35,7 @@ #define print_ns(x) ((x) / 10), ((x) % 10) /** - * s3c2412_print_timing - print timing infromation via printk. + * s3c2412_print_timing - print timing information via printk. * @pfx: The prefix to print each line with. * @iot: The IO timing information */ -- cgit v1.2.3-59-g8ed1b