Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756037AbdDRJjk (ORCPT ); Tue, 18 Apr 2017 05:39:40 -0400 Received: from mout.web.de ([212.227.15.14]:52265 "EHLO mout.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754400AbdDRJja (ORCPT ); Tue, 18 Apr 2017 05:39:30 -0400 Subject: [PATCH 2/6] clk: hisilicon: Delete error messages for failed memory allocations in hisi_clk_init() 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: <362845e2-00da-9631-a049-1a53749a1fcf@users.sourceforge.net> Date: Tue, 18 Apr 2017 11:39:16 +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:PC17WDUEulk29cWHEKmFRdNQlQcxjt9IYHLMggmZcBQDncRr4uO wyjbIu1Wg9AhnCsi4R3T5F8uNo9uI5TkPIQFgL4KhrlWWmDa+vpqX3cUQAd2nAKfikbUWpo K1lO6vSyh7DYC0d2nzP8pmWahA576cuwUsRuQaCi2inHW/1Ja4vlgiH48YypzYcYzOY4QZP umoiIpmOsVer2D+1MSiLQ== X-UI-Out-Filterresults: notjunk:1;V01:K0:lUl9n2e889I=:EYIzhQAHOnhosxaia+Ixeh s1f6KiVXo+Ke1WsNhD8sg5dhKSxTGlqB4Kvr22UKnSx5IYaTVIOIm+1iSYIIaPubNkTR7m4fP BAXLcix2+qUJ+F5/6NMQHvRi9f9scbMw7N9nGpIiDV4V8mGjHKt4i/GEz1JJdz2UxVS4SK7Q9 r88wc1iScJ2BHzwcG3C2vJq6rTqJs4GYLzCHUKN8pR0zmPPqYf75aCI17xefWNTx5hRk8DumG V6dWPIkoqEVnmk/5cfP3ORP4yZgjYosMbrwb+z/wto6NWM/FbJMixzxxEx3+NBGL+ryDm1d+2 8Mn/z6dQfzFYVDfEenqQtNQzg7TSGfEVpxeXHRWlFHsjztsWj9MESHl4ryNijNeNkngnyqM14 59SftGnna/xBz4ei+E64780jx8HTuohY32H7D+V/AEqoi5ntcodRzwrr7n7ndRym+xy6GqvBe aiJBKZ9G+31dVY7OH06X7Knu+SkSksbN+LniIJ6OGPcp7eczrxJIaUSh1Euz6UCSqcuJPYIcA b38SAc/IUuWOFH7Xdx9a3vFaPHvpwbh7dL7DB4AI6U1mQONx8c2FzcTYl/4I1gcapqAmNPvyi N6Nw6XNpcfA3czRDlLu4pOcmGmN71DAb2+TMTU8vm1oomFp6sGBHTVjGxVoxrklGweRsR4vJt gFLJDa3Gtw2i7CFLXVaCLiqnEDH8iHijMCPcxj+HyTc8zH6QjYrF3Q2JXYCZv8tiJ4QbaHrq7 Evokq0IA+zwfnDg4u1mbQHXnHY1wr78Jzq5He53AefgrPhYHQ+8VZOr18MomfMyIukXqGbpKx 1FzKlyt Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1332 Lines: 42 From: Markus Elfring Date: Tue, 18 Apr 2017 10:12:32 +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.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/drivers/clk/hisilicon/clk.c b/drivers/clk/hisilicon/clk.c index 9268e80b7566..eca4c66e316c 100644 --- a/drivers/clk/hisilicon/clk.c +++ b/drivers/clk/hisilicon/clk.c @@ -80,16 +80,14 @@ struct hisi_clock_data *hisi_clk_init(struct device_node *np, } clk_data = kzalloc(sizeof(*clk_data), GFP_KERNEL); - if (!clk_data) { - pr_err("%s: could not allocate clock data\n", __func__); + if (!clk_data) goto err; - } + clk_data->base = base; clk_table = kcalloc(nr_clks, sizeof(*clk_table), GFP_KERNEL); - if (!clk_table) { - pr_err("%s: could not allocate clock lookup table\n", __func__); + if (!clk_table) goto err_data; - } + clk_data->clk_data.clks = clk_table; clk_data->clk_data.clk_num = nr_clks; of_clk_add_provider(np, of_clk_src_onecell_get, &clk_data->clk_data); -- 2.12.2