Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S969939AbdIZSVc (ORCPT ); Tue, 26 Sep 2017 14:21:32 -0400 Received: from mout.web.de ([217.72.192.78]:51372 "EHLO mout.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S966343AbdIZSVa (ORCPT ); Tue, 26 Sep 2017 14:21:30 -0400 Subject: [PATCH 1/4] clk-u300: Delete an error message 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 References: Message-ID: <786e8b0c-a208-8ced-a566-905bae6ca394@users.sourceforge.net> Date: Tue, 26 Sep 2017 20:21:24 +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: Content-Type: text/plain; charset=utf-8 Content-Language: en-GB Content-Transfer-Encoding: 8bit X-Provags-ID: V03:K0:+K55dJqChiyluO7cAlIqOxbGjp4ABZxw1DYE83ZSxPOq5EPclPf 1LOeBv7Rit2tCWulGHMCeBHyWu1Aks5kvIgP1VhiiaUtyh5fX7bBc6UN5AQlvF2ekVuRqec UwkWHLauj5qypvLYWvBdE0Vg1p4nrznVN/mZvLSH+WvE/vcQZ/24mpKEV4ZCvR2SWwCRFga +pLuAURlzB64b4WI9P2rQ== X-UI-Out-Filterresults: notjunk:1;V01:K0:ELqfheifzSE=:qDqnFtXaEqTW4KM3p67/F0 fC3rxRR2PRTvSCh+Dlw2qPtCv4k6hGkWpqyj28nM9EXtPoLzXJ6CmpNVtKUP5yunnbGeby5D5 3Tp8fLWd97Tpr2wC1LO/SCHuXenpiyS1GOeSVKXv+XmagiKmYFBL3pw3nS7D5gI5C+AJpeYfm 15N1C5c1//fAkDf/YSTwSsoln0Gn8qFmO+ZON5ba92A/OyUSBkemN7Ap4t9HpVZwDTf9wrxMP 6+eQDTejV6xHHzViTC9H7r2BqE+BEyOoZodBWTv7aGsM/mX9HRDmbjqdj8kTOzKw2HRfmrCaJ CNFjUDRqrvyQVpw/GBR8686wn8ezbdNecRx2FiRX/JJ1ezxtOQ8W7QW66sQ+iwoebm4uD9f/6 6Gb1MReMhQ+iT0A89coe+Mm+P8kQerJsCMeWLlLn2LFvu4a7GRAvHdDfL1kpJkJquPdbgwH/g 1DxOkV5KNxns88rTEsCvGvagQjPPJMf3iqlRvNFYd3YdIx1GU7DNLatTwOqfmEflqsTKNuGzT zjtOv36QKemG+fDoPq5zgnEHrCYtWGKNyLHkmQl3sEK4CV9qD3VlDrDrrxU5siQMwfyz9cPsL THzjTP3/m3NE3jZSKliz7BLpLeSlKxgWdJNvk1X7NUG6VGBJygYoDQsHHbst4IsDYGKer3N8b MIygrXRFPpSYsRORFYV7+xnryzp72LrChN2n95FRlDSrtqvS7FSFgfybK3nW06aJnlnDpY/zD DIfC+xnE0twUNTgBKX8Gku4NlOYytbF0LVL5NsgRjrimrjUFlehcCHJvZ/Sv1aitCMZG+APgX OWKYENZxU5AnEUWUJM1J1bCGcdoDcsobiGtNRHb9xO/5PqM7iI= Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1236 Lines: 46 From: Markus Elfring Date: Tue, 26 Sep 2017 19:30:46 +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/clk-u300.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/drivers/clk/clk-u300.c b/drivers/clk/clk-u300.c index ec8aafda6e24..e524c3775264 100644 --- a/drivers/clk/clk-u300.c +++ b/drivers/clk/clk-u300.c @@ -703,11 +703,9 @@ syscon_clk_register(struct device *dev, const char *name, int ret; sclk = kzalloc(sizeof(struct clk_syscon), GFP_KERNEL); - if (!sclk) { - pr_err("could not allocate syscon clock %s\n", - name); + if (!sclk) return ERR_PTR(-ENOMEM); - } + init.name = name; init.ops = &syscon_clk_ops; init.flags = flags; @@ -1124,11 +1122,9 @@ mclk_clk_register(struct device *dev, const char *name, int ret; mclk = kzalloc(sizeof(struct clk_mclk), GFP_KERNEL); - if (!mclk) { - pr_err("could not allocate MMC/SD clock %s\n", - name); + if (!mclk) return ERR_PTR(-ENOMEM); - } + init.name = "mclk"; init.ops = &mclk_ops; init.flags = 0; -- 2.14.1