From patchwork Wed Sep 27 07:25:03 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: 9973251 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 7CBC760375 for ; Wed, 27 Sep 2017 07:26:16 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 70A34290D6 for ; Wed, 27 Sep 2017 07:26:16 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 65B4B290D8; Wed, 27 Sep 2017 07:26:16 +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=ham 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 A11B5290D7 for ; Wed, 27 Sep 2017 07:26:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751797AbdI0HZP (ORCPT ); Wed, 27 Sep 2017 03:25:15 -0400 Received: from mout.web.de ([212.227.15.3]:51133 "EHLO mout.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750917AbdI0HZO (ORCPT ); Wed, 27 Sep 2017 03:25:14 -0400 Received: from [192.168.1.3] ([77.182.208.134]) by smtp.web.de (mrweb003 [213.165.67.108]) with ESMTPSA (Nemesis) id 0M6Dve-1d81EI2xb8-00y5Bt; Wed, 27 Sep 2017 09:25:04 +0200 Subject: [PATCH 1/3] clk/mmp: Delete an error message for a failed memory allocation in three functions From: SF Markus Elfring To: linux-clk@vger.kernel.org, Chao Xie , Michael Turquette , Stephen Boyd Cc: LKML , kernel-janitors@vger.kernel.org References: <051d7ba6-e3cc-8354-8315-93fe039dd2ce@users.sourceforge.net> Message-ID: <5a3e0b55-1eda-87a4-c4e3-d142d64830a5@users.sourceforge.net> Date: Wed, 27 Sep 2017 09:25:03 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.3.0 MIME-Version: 1.0 In-Reply-To: <051d7ba6-e3cc-8354-8315-93fe039dd2ce@users.sourceforge.net> Content-Language: en-GB X-Provags-ID: V03:K0:1hdb6VOX6uHegXr9RANrj/0PSQmRg+8K5B0Nx2cUkqUOYjCAnId uvy7Fy4QBGLTztTStdE2yWzUShj/Yj9aozeIMXMB2bFs5FqjdH6DyZtquE2wCzj5KpRtB/j o4e6OcrRnl65Hmwk/NFVtsrta1RRHJ8JcxsmSRBCbL+3mEYueFYWCIiBMmeGegc3J6jSJns MUnc8i6Qt0pGFnLeMf4oA== X-UI-Out-Filterresults: notjunk:1; V01:K0:mLZXfCRziog=:xFaGBex6/R6bhxiLvrv+O/ be/xyIIQPyctYpAT45nnvJ9vG4sUVZcdyYfTBk6RDvKEMbsl7EVHTGK7PTMB6uHRah1L+S6k9 4+or7Me+NZuKI3OIUXDgjO5OXQhXUoQ1IoyQW2UqMYt5gh/nVjc9ZOUAvWXoRpue2q0Pd5ro5 y+Y0q6329gP40gHeV7QPBBgGGCTl456/S5IGgKx4Qn1btSNG2+0IUhXrObxi36FbmcVmZkrWI auvJQcNgRvyab/n8HPERI8vcLS6OgDrpuWLSjB6GaSUo+N+OlbQPA+EE7Ejb4QgxgIw79BjPZ Wwungmyj1NFRmsir/481aFn5TJbmJ/Kwvfjh0WluQBsPbTKMtTWP2fB+QH5nQhkaIUBrM3Tef fPZTZr9X40cMlD5gLsiUs1+xnyo7MR6ssNjETMTIz88PAMe+rKwx+gKPJnMKtq0iybnxJOA1L NXl49jYbuTrpf03KXzgWEohyEqqnfxahc2dqO3SNEdIikahMVRvMnkuwhd7ltjDM6TPItpVyc xfpxnFhox+pdGwNwQgh8aB4mt1oW045TmigegVQ2+OWEibV3HUkIschf11jAcqoqs7jZ41TH9 xidsjI9HiretDn9SFRSMz/X2AiHL5LmF1lJDuYB32uGXaQyRN+pjL2di7Pw8Pk2/LuhmRTuCo UF756JQScawWZaDz80tgtaRVSBRsQA+L23b++MRTQrnW+lfGs39bIAeCqoDvZ/VtfSrFWh6g7 l7ptMIGCGi/zNtWBqYLFmncKAjHTQQbjJmAxeKGLb/FSlWe4d6CboxtZFZVcAD9ydrv+4+j9j zuccdMXjJRewxiAaG0rY8LYxGv5jkztZ8bwuhSnfo4Xcpi3eH8= 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: Tue, 26 Sep 2017 22:25:38 +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 --- drivers/clk/mmp/clk-frac.c | 4 +--- drivers/clk/mmp/clk-gate.c | 4 +--- drivers/clk/mmp/clk-mix.c | 9 +-------- 3 files changed, 3 insertions(+), 14 deletions(-) diff --git a/drivers/clk/mmp/clk-frac.c b/drivers/clk/mmp/clk-frac.c index 584a9927993b..98dfb9568d4f 100644 --- a/drivers/clk/mmp/clk-frac.c +++ b/drivers/clk/mmp/clk-frac.c @@ -172,10 +172,8 @@ struct clk *mmp_clk_register_factor(const char *name, const char *parent_name, } factor = kzalloc(sizeof(*factor), GFP_KERNEL); - if (!factor) { - pr_err("%s: could not allocate factor clk\n", __func__); + if (!factor) return ERR_PTR(-ENOMEM); - } /* struct clk_aux assignments */ factor->base = base; diff --git a/drivers/clk/mmp/clk-gate.c b/drivers/clk/mmp/clk-gate.c index d20cd3431ac2..7355595c42e2 100644 --- a/drivers/clk/mmp/clk-gate.c +++ b/drivers/clk/mmp/clk-gate.c @@ -103,10 +103,8 @@ struct clk *mmp_clk_register_gate(struct device *dev, const char *name, /* allocate the gate */ gate = kzalloc(sizeof(*gate), GFP_KERNEL); - if (!gate) { - pr_err("%s:%s could not allocate gate clk\n", __func__, name); + if (!gate) return ERR_PTR(-ENOMEM); - } init.name = name; init.ops = &mmp_clk_gate_ops; diff --git a/drivers/clk/mmp/clk-mix.c b/drivers/clk/mmp/clk-mix.c index c554833cffc5..1ae532df20f7 100644 --- a/drivers/clk/mmp/clk-mix.c +++ b/drivers/clk/mmp/clk-mix.c @@ -451,11 +451,8 @@ struct clk *mmp_clk_register_mix(struct device *dev, size_t table_bytes; mix = kzalloc(sizeof(*mix), GFP_KERNEL); - if (!mix) { - pr_err("%s:%s: could not allocate mmp mix clk\n", - __func__, name); + if (!mix) return ERR_PTR(-ENOMEM); - } init.name = name; init.flags = flags | CLK_GET_RATE_NOCACHE; @@ -468,8 +465,6 @@ struct clk *mmp_clk_register_mix(struct device *dev, table_bytes = sizeof(*config->table) * config->table_size; mix->table = kmemdup(config->table, table_bytes, GFP_KERNEL); if (!mix->table) { - pr_err("%s:%s: could not allocate mmp mix table\n", - __func__, name); kfree(mix); return ERR_PTR(-ENOMEM); } @@ -481,8 +476,6 @@ struct clk *mmp_clk_register_mix(struct device *dev, mix->mux_table = kmemdup(config->mux_table, table_bytes, GFP_KERNEL); if (!mix->mux_table) { - pr_err("%s:%s: could not allocate mmp mix mux-table\n", - __func__, name); kfree(mix->table); kfree(mix); return ERR_PTR(-ENOMEM);