From patchwork Wed Sep 27 18:46:45 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: 9974571 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 4236B6037F for ; Wed, 27 Sep 2017 18:47:18 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 368B928A2D for ; Wed, 27 Sep 2017 18:47:18 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2B69D29151; Wed, 27 Sep 2017 18:47:18 +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 BD03328A2D for ; Wed, 27 Sep 2017 18:47:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752069AbdI0SrR (ORCPT ); Wed, 27 Sep 2017 14:47:17 -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 Received: from [192.168.1.3] ([92.228.186.72]) by smtp.web.de (mrweb101 [213.165.67.124]) with ESMTPSA (Nemesis) id 0MX0Q4-1dtrb03eSa-00Vvi0; Wed, 27 Sep 2017 20:46:47 +0200 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-Language: en-GB 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-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: 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 Acked-by: Ulf Hansson --- 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];