From patchwork Tue Sep 26 18:21:24 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: 9972489 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 D90AE6037F for ; Tue, 26 Sep 2017 18:21:33 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id CA12D28911 for ; Tue, 26 Sep 2017 18:21:33 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id BEF2928EF4; Tue, 26 Sep 2017 18:21:33 +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 3F27728911 for ; Tue, 26 Sep 2017 18:21:33 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S969406AbdIZSVc (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 Received: from [192.168.1.3] ([78.49.148.35]) by smtp.web.de (mrweb103 [213.165.67.124]) with ESMTPSA (Nemesis) id 0M2571-1d3YmE1V9f-00u0Jp; Tue, 26 Sep 2017 20:21:25 +0200 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-Language: en-GB 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-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, 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;