From patchwork Wed Sep 27 16:15:26 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: SF Markus Elfring X-Patchwork-Id: 9974385 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 75840603F2 for ; Wed, 27 Sep 2017 16:16:11 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6837D2913B for ; Wed, 27 Sep 2017 16:16:11 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5CF5B286EE; Wed, 27 Sep 2017 16:16:11 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=unavailable version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0FF1F2913B for ; Wed, 27 Sep 2017 16:16:11 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751998AbdI0QQK (ORCPT ); Wed, 27 Sep 2017 12:16:10 -0400 Received: from mout.web.de ([212.227.17.11]:57789 "EHLO mout.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751450AbdI0QQJ (ORCPT ); Wed, 27 Sep 2017 12:16:09 -0400 Received: from [192.168.1.3] ([92.228.186.72]) by smtp.web.de (mrweb103 [213.165.67.124]) with ESMTPSA (Nemesis) id 0Lrazp-1dDgVu0Zp7-013K08; Wed, 27 Sep 2017 18:15:35 +0200 To: linux-arm-kernel@lists.infradead.org, linux-clk@vger.kernel.org, Michael Turquette , Stephen Boyd , Viresh Kumar Cc: LKML , kernel-janitors@vger.kernel.org From: SF Markus Elfring Subject: [PATCH] clk/spear: Delete five error messages for a failed memory allocation Message-ID: <4283fdab-7005-f774-9594-821582c5a9fb@users.sourceforge.net> Date: Wed, 27 Sep 2017 18:15:26 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.3.0 MIME-Version: 1.0 Content-Language: en-GB X-Provags-ID: V03:K0:bXEOE2dEGv+mLvmIM697dIxKtx3CzQk8nM7vkLlf8Okv+VAarZ9 jBbVCwsWCwPsrvZMxiyh7sagpcdZXYSPYSrdzIjUgVHIqd/Dce3oGF+qMFpWJZIFsNdN8fr 28aZ9LrAfn9cI5LO0KoWZrcNQKBHTOWYlzcRwqgzYx2SogOiW6qdLvERmO+NgAQMMncGyhn sFJP+tSt3ppvR0IL2o38A== X-UI-Out-Filterresults: notjunk:1; V01:K0:Z3fnTRUXbQs=:m8KFZxgxvv68b9OARIrzQ1 cVPjHH1uS69cvIW5mR3kFjMqnBrkskht/bEGQKo2Sii5U3VmR51+DBWNdwD+vDOKEo7VygWCr /J09v5v5FEACR0dlkzmY5X4Llq19PHoH7bZqPVzMSfobuPSbZPwk88ipRhJKbLZEyy9qGOgfP M5UpD6mn895+vOArYKQHmut6vbim046wE5PG69kYvEbF5xqThCgIEhi7OKBP9BhMk6a7L1pu4 pJVxbNj8TCXyRzjOxsY0RdXHuFjVTuKIKG148N1KgO2NYAUl11L2z5m6+YT5tWNUCyQ9I/Rzx NBrS1bIw0J5rDG0N8phK384eDeT2QnXBTjS2PlVWUeOeMS+pLjwNelv3PcTwJWmJHhULjyQhB gllVtSF8eyJ9lvd8YzA90Xkrl2zf3NPz7MIVpWgaze/jNjvsh5zqpsyk78YZC2WVceVHaZMEd SSmcDks2HAHHri68yITkCDxFcIs1gZ+RiuL8WECpxIRByveQRpN55wYc0dgV5tEzXeh/k8jtP GY9vILZoT6eRsQnKVAS/7XOMLPRTyWMAfTKdb0RsY3VlmM7AdZXIosG3UU05Ig1J+zKUsf0BM QWpeXCgcqPfOJAsw5uoEZakUXcjbePXnxmJ/vgwxRlnIhOldJxS0YjQXB20SuelUxJAt3qO0J v8MQ3i5sp4xDT0xP/bGyaCtddjb95IcW4jJdrhKjzzCY2stvGAskFgNzImvsg3keu1Tu4KE5j 7+K5/O6wG0D3C6/8Qn644TEaLGZ0Fm4u3hZtKa8OQFGZK5cqn+o1RoLo69GMyznjZqiAvPu4h dbXjOhxMHQtNtG1fSikqwk47YmK2c1CFcfHPKMDeOt6WhylfkY= Sender: linux-clk-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-clk@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Markus Elfring Date: Wed, 27 Sep 2017 18:00:21 +0200 Omit extra messages for a memory allocation failure in these functions. This issue was detected by using the Coccinelle software. Signed-off-by: Markus Elfring Acked-by: Viresh Kumar --- drivers/clk/spear/clk-aux-synth.c | 4 +--- drivers/clk/spear/clk-frac-synth.c | 4 +--- drivers/clk/spear/clk-gpt-synth.c | 4 +--- drivers/clk/spear/clk-vco-pll.c | 8 ++------ 4 files changed, 5 insertions(+), 15 deletions(-) diff --git a/drivers/clk/spear/clk-aux-synth.c b/drivers/clk/spear/clk-aux-synth.c index f271c350ef94..ee7a7c043e3b 100644 --- a/drivers/clk/spear/clk-aux-synth.c +++ b/drivers/clk/spear/clk-aux-synth.c @@ -149,10 +149,8 @@ struct clk *clk_register_aux(const char *aux_name, const char *gate_name, } aux = kzalloc(sizeof(*aux), GFP_KERNEL); - if (!aux) { - pr_err("could not allocate aux clk\n"); + if (!aux) return ERR_PTR(-ENOMEM); - } /* struct clk_aux assignments */ if (!masks) diff --git a/drivers/clk/spear/clk-frac-synth.c b/drivers/clk/spear/clk-frac-synth.c index 58d678b5b40a..c48f3ed2d570 100644 --- a/drivers/clk/spear/clk-frac-synth.c +++ b/drivers/clk/spear/clk-frac-synth.c @@ -136,10 +136,8 @@ struct clk *clk_register_frac(const char *name, const char *parent_name, } frac = kzalloc(sizeof(*frac), GFP_KERNEL); - if (!frac) { - pr_err("could not allocate frac clk\n"); + if (!frac) return ERR_PTR(-ENOMEM); - } /* struct clk_frac assignments */ frac->reg = reg; diff --git a/drivers/clk/spear/clk-gpt-synth.c b/drivers/clk/spear/clk-gpt-synth.c index 1a722e99e76e..6e95d7f3ade9 100644 --- a/drivers/clk/spear/clk-gpt-synth.c +++ b/drivers/clk/spear/clk-gpt-synth.c @@ -125,10 +125,8 @@ struct clk *clk_register_gpt(const char *name, const char *parent_name, unsigned } gpt = kzalloc(sizeof(*gpt), GFP_KERNEL); - if (!gpt) { - pr_err("could not allocate gpt clk\n"); + if (!gpt) return ERR_PTR(-ENOMEM); - } /* struct clk_gpt assignments */ gpt->reg = reg; diff --git a/drivers/clk/spear/clk-vco-pll.c b/drivers/clk/spear/clk-vco-pll.c index dc21ca4601aa..e06b821fa60e 100644 --- a/drivers/clk/spear/clk-vco-pll.c +++ b/drivers/clk/spear/clk-vco-pll.c @@ -292,16 +292,12 @@ struct clk *clk_register_vco_pll(const char *vco_name, const char *pll_name, } vco = kzalloc(sizeof(*vco), GFP_KERNEL); - if (!vco) { - pr_err("could not allocate vco clk\n"); + if (!vco) return ERR_PTR(-ENOMEM); - } pll = kzalloc(sizeof(*pll), GFP_KERNEL); - if (!pll) { - pr_err("could not allocate pll clk\n"); + if (!pll) goto free_vco; - } /* struct clk_vco assignments */ vco->mode_reg = mode_reg;