From: Markus Elfring Date: Sat, 3 Jun 2017 19:34:48 +0000 (+0200) Subject: ARM: pxa: Delete an error message for a failed memory allocation in pxa_pm_init() X-Git-Tag: v4.13-rc1~169^2~11^2~2 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=c276557de3087ef67ad1aec4222f9f8b1d005f80;p=karo-tx-linux.git ARM: pxa: Delete an error message for a failed memory allocation in pxa_pm_init() Omit an extra message for a memory allocation failure in this function. This issue was detected by using the Coccinelle software. Link: http://events.linuxfoundation.org/sites/events/files/slides/LCJ16-Refactor_Strings-WSang_0.pdf Signed-off-by: Markus Elfring Signed-off-by: Robert Jarzmik --- diff --git a/arch/arm/mach-pxa/pm.c b/arch/arm/mach-pxa/pm.c index e7450fb49d24..f2237f471750 100644 --- a/arch/arm/mach-pxa/pm.c +++ b/arch/arm/mach-pxa/pm.c @@ -107,10 +107,8 @@ static int __init pxa_pm_init(void) sleep_save = kmalloc_array(pxa_cpu_pm_fns->save_count, sizeof(*sleep_save), GFP_KERNEL); - if (!sleep_save) { - printk(KERN_ERR "failed to alloc memory for pm save\n"); + if (!sleep_save) return -ENOMEM; - } suspend_set_ops(&pxa_pm_ops); return 0;