Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755580AbdDRJpE (ORCPT ); Tue, 18 Apr 2017 05:45:04 -0400 Received: from mout.web.de ([212.227.15.3]:62381 "EHLO mout.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932261AbdDRJnb (ORCPT ); Tue, 18 Apr 2017 05:43:31 -0400 Subject: [PATCH 5/6] clk: hi3620: Delete error messages for a failed memory allocation in two functions From: SF Markus Elfring To: linux-clk@vger.kernel.org, Jiancheng Xue , Michael Turquette , Stephen Boyd Cc: LKML , kernel-janitors@vger.kernel.org, Wolfram Sang References: <7a649967-8ff1-8682-2f87-43871172fc28@users.sourceforge.net> Message-ID: Date: Tue, 18 Apr 2017 11:43:21 +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: <7a649967-8ff1-8682-2f87-43871172fc28@users.sourceforge.net> Content-Type: text/plain; charset=utf-8 Content-Language: en-GB Content-Transfer-Encoding: 7bit X-Provags-ID: V03:K0:8S9f4im2gpu2RXZPttVRGoJbYM9SIyGI226LR/67p6+Qx41Z+cK LQL3C2Md9EqW+1SK2eQqFK7tOYY5/aTwV/BzzpuR3dAyRBJpt5kRrJuDUYta0iXsepvTcCu yvUjcd+TWdnsb2Naux8q8MeK7i00gNO/PwAeQ3U+yVd7wdfaQ4xtV8vxQxiJNL+l+WooN4b p38XC9Sg2Te7upTTGy/Gg== X-UI-Out-Filterresults: notjunk:1;V01:K0:NmxOFVBdyGM=:127sinvAcFZAiXqQVWr/kR x3zLcQtmUKTBCbPC20xs8aK+W9gL+LsA59OdPjyUIvQJeJM4DN2gKMmumoC4XbVvC2nkDAqHw MpPkNQrceupa7WR4LjjQJnVOmEWGiHuOy+DbVe5lHjhWp5Uvz/gnsDkp/PphiLkWbCg67tb5S dFaqItsLcSGwx9GnwDJ5ce44WOy2upq1BuFxQuANXaY4vmPsIgPofOEWYKdc29RgHWc3WJa7U +aqjsOpbZ5p91+ZnEFxkaVhiLvkb5TpoZzytToY3V/wciWOfGeZpUds9HC1G+iMvvIFOI4QUd cTm1Wd5V+vdbPyMn0oiS2hmxLvSbEeKIfaX1XWjTJ1tkc6inCbJQrA3N84BclmCV+Nsopqagm DCxrK5hzaF7QArPqCMhBo6cAkEQJzWuUORtTOBiyj6WIBXjP5+/VkWZOo/GZvYlW7nO2aztkL TnxnTh+I0vpQPipBY1ls6UEkeRLpmt1+EIHZA07/vNMW18ARZUSptCxCtp02d7W9+7/3UIcRq 6Hfba7udwtGtq8M2VTYXdXql0AOJlhP7iWY3zCHa0JB5ujLjr4egqDw9Ymwg1fjSxLCyMxRFo uiD99hz8f8eT+0HHGAVyisR41b/+uLBSHLj1q2jzd/9jfRcFrF3G+p1KARr2IImtOXArhKCYv JcosAS+E3xuYQZNJoWsox5OEdiif3D2spBamNCgsKqXSrE9pD7pVrjv3FyS0zp4Tvj74huTh5 R130PpvXPncPSUF47rurDXJGp0ZIgc2x8+jxfREdH4HKtBYhdLrAIqKr0mTHuvuETSz8ykOld 0KJFxFx Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1457 Lines: 45 From: Markus Elfring Date: Tue, 18 Apr 2017 10:50:53 +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/hisilicon/clk-hi3620.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/drivers/clk/hisilicon/clk-hi3620.c b/drivers/clk/hisilicon/clk-hi3620.c index f6dd971c9d3c..33a713ac8fe6 100644 --- a/drivers/clk/hisilicon/clk-hi3620.c +++ b/drivers/clk/hisilicon/clk-hi3620.c @@ -430,10 +430,8 @@ static struct clk *hisi_register_clk_mmc(struct hisi_mmc_clock *mmc_clk, struct clk_init_data init; mclk = kzalloc(sizeof(*mclk), GFP_KERNEL); - if (!mclk) { - pr_err("%s: fail to allocate mmc clk\n", __func__); + if (!mclk) return ERR_PTR(-ENOMEM); - } init.name = mmc_clk->name; init.ops = &clk_mmc_ops; @@ -483,10 +481,8 @@ static void __init hi3620_mmc_clk_init(struct device_node *node) return; clk_data->clks = kcalloc(num, sizeof(*clk_data->clks), GFP_KERNEL); - if (!clk_data->clks) { - pr_err("%s: fail to allocate mmc clk\n", __func__); + if (!clk_data->clks) return; - } for (i = 0; i < num; i++) { struct hisi_mmc_clock *mmc_clk = &hi3620_mmc_clks[i]; -- 2.12.2