Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752194AbdI0SrS (ORCPT ); Wed, 27 Sep 2017 14:47:18 -0400 Received: from mout.web.de ([212.227.17.11]:49600 "EHLO mout.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751073AbdI0SrQ (ORCPT ); Wed, 27 Sep 2017 14:47:16 -0400 Subject: [PATCH 1/2] clk/ux500: Delete an error message for a failed memory allocation in three functions From: SF Markus Elfring To: linux-arm-kernel@lists.infradead.org, linux-clk@vger.kernel.org, Michael Turquette , Stephen Boyd , Ulf Hansson Cc: LKML , kernel-janitors@vger.kernel.org References: Message-ID: Date: Wed, 27 Sep 2017 20:46:45 +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:XDV/ZvzGDRN0aYhyuCvFd/Hf/aikMrjyUk6JBwgQZv7Lth0pp3e mH6fQMJU5QlCSQBYFXsW+lppQ1hp56yW8UocyjwxUCdi1Jba8Nzqy0KAzfyxFGIeYDsicHI PGxz8ubcICqHjRdqYK250qT208Zl6b5BWXOjaY5of/wm4k9WVr8m8bVB+ymEm81Bu/1toPD S4OpSpRANaeirdBsiPkCQ== X-UI-Out-Filterresults: notjunk:1;V01:K0:HEoGJ76Lzfg=:ikvwyHXx7dieQKKhee0nZ4 wunSHf8XRiprHWvzIkA+dArlXRsQIAiq3UTLOu81v9REwIdPKAQtOeBS2CRATzvLs8Tbr1uU0 eJVrjhd/OgYue7BmtzKPm4lkLfyWp6LdPaFvAmIbvce/X35aNAxI+JgLuJqnPqpiW2PUrowAH d9q7tuEjinRAZx4eA0lrlzwY5U/XAcPZEvnVJfio6MN3uIcTLhi1kTRcv633f3RJrpZ3bjH+K WCKmlqfS21jGws+mIWo/rosCPv/EBahzHuhYj/+wNjj5ObX5ND05qbdaL7WMUM7wQ6xxEIb2M uz4RTuVgDJSFChBwOBM7tRC705UClF0Fe2VU4xrO5oyD0WV8+M4g9xwMyXAf9/7VjdDP4I1OI zxPTeT1YfnzXvLzbcSDmoStOyaYlelkauvCh2Pr4xpT727dDcqk8flLalS+FO9K/NBfKCIhHL a58Na5r5FPCJXAInti80NCsuub7oRI60miUrqtakTtW1+H56qkpqalZXMORrTXGD+FRqIAz0A zxNe3LcVyWgzP9VmCPKdKEwDr7QKL6Pu5NeDFv7KM8jPwYUuxpspkuvQ6sRcpOT5axUu4hJp9 VcdYJmTz2P+D5pL3FsdlqGOtF050CQjI5RIr6/PQQASIiJWkJ+MNj35ktYIIc2WbgmAfgrlQR HrysIpP2GX/PqLUh4h0EmNFO0FyFYOyB/Nc3C80tShUAbq9CT6fhM0rdNc/9nn02qEQXnCTc+ ZKOeNwcXkY4rrOn3MW6KqVjloO2XYZLdeQLQPw5+q7kZ3fPKs0zk7ST/d6MuLccCJFT29cCx1 nnBD+aXog70fpIkEzJwQcYTqRKcUjbCPmG+Wb7g6SCP/V2wXIQ= Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1990 Lines: 64 From: Markus Elfring Date: Wed, 27 Sep 2017 20:23:58 +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/ux500/clk-prcc.c | 4 +--- drivers/clk/ux500/clk-prcmu.c | 4 +--- drivers/clk/ux500/clk-sysctrl.c | 4 +--- 3 files changed, 3 insertions(+), 9 deletions(-) diff --git a/drivers/clk/ux500/clk-prcc.c b/drivers/clk/ux500/clk-prcc.c index f50592775c9d..5ca07e6d1f64 100644 --- a/drivers/clk/ux500/clk-prcc.c +++ b/drivers/clk/ux500/clk-prcc.c @@ -108,10 +108,8 @@ static struct clk *clk_reg_prcc(const char *name, } clk = kzalloc(sizeof(struct clk_prcc), GFP_KERNEL); - if (!clk) { - pr_err("clk_prcc: %s could not allocate clk\n", __func__); + if (!clk) return ERR_PTR(-ENOMEM); - } clk->base = ioremap(phy_base, SZ_4K); if (!clk->base) diff --git a/drivers/clk/ux500/clk-prcmu.c b/drivers/clk/ux500/clk-prcmu.c index 6e3e16b2e5ca..c137934f23ab 100644 --- a/drivers/clk/ux500/clk-prcmu.c +++ b/drivers/clk/ux500/clk-prcmu.c @@ -259,10 +259,8 @@ static struct clk *clk_reg_prcmu(const char *name, } clk = kzalloc(sizeof(struct clk_prcmu), GFP_KERNEL); - if (!clk) { - pr_err("clk_prcmu: %s could not allocate clk\n", __func__); + if (!clk) return ERR_PTR(-ENOMEM); - } clk->cg_sel = cg_sel; clk->is_prepared = 1; diff --git a/drivers/clk/ux500/clk-sysctrl.c b/drivers/clk/ux500/clk-sysctrl.c index 8a4e93ce1e42..e0a834c08a04 100644 --- a/drivers/clk/ux500/clk-sysctrl.c +++ b/drivers/clk/ux500/clk-sysctrl.c @@ -140,10 +140,8 @@ static struct clk *clk_reg_sysctrl(struct device *dev, } clk = devm_kzalloc(dev, sizeof(struct clk_sysctrl), GFP_KERNEL); - if (!clk) { - dev_err(dev, "clk_sysctrl: could not allocate clk\n"); + if (!clk) return ERR_PTR(-ENOMEM); - } /* set main clock registers */ clk->reg_sel[0] = reg_sel[0]; -- 2.14.2