Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1030636AbdDTIca (ORCPT ); Thu, 20 Apr 2017 04:32:30 -0400 Received: from mout.web.de ([212.227.15.4]:65505 "EHLO mout.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S943715AbdDTIcZ (ORCPT ); Thu, 20 Apr 2017 04:32:25 -0400 Subject: [PATCH 8/8] clk: nomadik: Delete error messages for a failed memory allocation in two functions From: SF Markus Elfring To: linux-clk@vger.kernel.org, Michael Turquette , Stephen Boyd Cc: LKML , kernel-janitors@vger.kernel.org, Wolfram Sang References: <94b24eaa-c5fb-80ea-441a-883989d14ef5@users.sourceforge.net> Message-ID: Date: Thu, 20 Apr 2017 10:32:18 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.0 MIME-Version: 1.0 In-Reply-To: <94b24eaa-c5fb-80ea-441a-883989d14ef5@users.sourceforge.net> Content-Type: text/plain; charset=utf-8 Content-Language: en-GB Content-Transfer-Encoding: 7bit X-Provags-ID: V03:K0:/PdoeynU9ZfEdU8McdLJaa2urVESMzQO2HAFVoff8e8PmT+otQs AVPMTTN6uzf9E/rpEaxAyF97rUdX/5C9kaAWE5lzmj/2vO850PJqIwNNfRv2/3iUheO2qtc dMvEGYnMH1i0sHyqJggkM5qRIVVT3Po+XpcNTOD7g56ZpcYNv8kv7V48v6pPSZCaYxKvQ5l VI40ewXfHZgsY6b8ZleKg== X-UI-Out-Filterresults: notjunk:1;V01:K0:EISLDtu5K0U=:kH253g4JGGDWJUc1V6tmr4 uYQrwyt+CCnaI3hsJoCYj+I+EA/PL2zn7V/VAQuzHwQQOj61klA27lFI8wf0n8+ubn9ei9zVz QfBtupkJB12TQdFkOKO1DPCmy541x7GHKa0v8ZmONPQsamh+DfpsKXtd7jtMLQLXUqrQveJnP AMtOUV9ALcED9FP37u4tR29M4efmxftwhiw8zFqIv036yYuZaz5zYy4LDziqkD26fdNkiZc7B MyAjeGpDdUZonUmG4NEn5duRHAjhP/j/Ks7Pq7Uhr5GRDhRhXB+/k4k/WUa41ZIpUt46WBOzF 5NbaqLNUnSnEGn9yGVfDMgnstT4MkFTwhCjpNHbPbp6GFfaZ5B3pxKm+kXcqtxgx5P4S9Gd1i k8667YQXqIhLO80iql0qhSEtPdBspcr2fu+lwhM35VbVtutVNySVuE6kAWY1OFTkH0Bcx0h2E iha7Kg/7MuEEq1V7++u8ADkp3DaQSrsmY/wxkCk0kGI26lm4lyXCGZbrFvW0vSoxOr7QjCPJH mgr5MwoVUMbyM/4mo+aNOKdcnvGAEWz12LFqWKqPcq+fofALE62U3moDLTiQGDSFRpR8u7N8+ VAh0nLLxyKAoUSDlGT62R/aTf4w0YdoOrhAijsy/8ogEhEYAiBliHs1ZXtFXX5s6O0HCoyNvj QOVpeEjRe6mGjO73HgK6cdp6ZJsdkEEO17SYhj57j2bMG4DQ4vClHwyFdxy8FLFjnP2ir3gwp dzuqtiLd5VYiAHxFwP8UaSGYf5IhoK/qdkLHXQqkd3iemn9DOOVpEl/SQ47/JWhOMDGNZizqL z4jPB12 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1361 Lines: 47 From: Markus Elfring Date: Thu, 20 Apr 2017 10:04:00 +0200 The script "checkpatch.pl" pointed information out like the following. WARNING: Possible unnecessary 'out of memory' message Thus remove such statements here. Link: http://events.linuxfoundation.org/sites/events/files/slides/LCJ16-Refactor_Strings-WSang_0.pdf Signed-off-by: Markus Elfring --- drivers/clk/clk-nomadik.c | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/drivers/clk/clk-nomadik.c b/drivers/clk/clk-nomadik.c index 8d57ab8d6ed8..13ad6d1e5090 100644 --- a/drivers/clk/clk-nomadik.c +++ b/drivers/clk/clk-nomadik.c @@ -267,10 +267,8 @@ pll_clk_register(struct device *dev, const char *name, } pll = kzalloc(sizeof(*pll), GFP_KERNEL); - if (!pll) { - pr_err("%s: could not allocate PLL clk\n", __func__); + if (!pll) return ERR_PTR(-ENOMEM); - } init.name = name; init.ops = &pll_clk_ops; @@ -356,11 +354,9 @@ src_clk_register(struct device *dev, const char *name, struct clk_init_data init; sclk = kzalloc(sizeof(*sclk), GFP_KERNEL); - if (!sclk) { - pr_err("could not allocate SRC clock %s\n", - name); + if (!sclk) return ERR_PTR(-ENOMEM); - } + init.name = name; init.ops = &src_clk_ops; /* Do not force-disable the static SDRAM controller */ -- 2.12.2