From patchwork Tue Apr 18 09:39:16 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: 9685241 X-Patchwork-Delegate: sboyd@codeaurora.org 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 3F36E602C9 for ; Tue, 18 Apr 2017 09:40:48 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 388C2206E2 for ; Tue, 18 Apr 2017 09:40:48 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2D7D9283F2; Tue, 18 Apr 2017 09:40:48 +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 ABF03206E2 for ; Tue, 18 Apr 2017 09:40:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755364AbdDRJjj (ORCPT ); Tue, 18 Apr 2017 05:39:39 -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 Received: from [192.168.1.2] ([77.181.207.195]) by smtp.web.de (mrweb004 [213.165.67.108]) with ESMTPSA (Nemesis) id 0M3PN2-1c9PNO0ByC-00r0ot; Tue, 18 Apr 2017 11:39:18 +0200 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-Language: en-GB 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-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, 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);