From patchwork Tue May 16 17:31:20 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: 9729423 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 424AC602DB for ; Tue, 16 May 2017 17:31:57 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2FAF6288A9 for ; Tue, 16 May 2017 17:31:57 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 23B87289D2; Tue, 16 May 2017 17:31:57 +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 A9705288A9 for ; Tue, 16 May 2017 17:31:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751221AbdEPRb3 (ORCPT ); Tue, 16 May 2017 13:31:29 -0400 Received: from mout.web.de ([212.227.17.12]:59858 "EHLO mout.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751002AbdEPRb2 (ORCPT ); Tue, 16 May 2017 13:31:28 -0400 Received: from [192.168.1.3] ([77.182.68.193]) by smtp.web.de (mrweb102 [213.165.67.124]) with ESMTPSA (Nemesis) id 0MEEeC-1dCq2O0e6a-00FROY; Tue, 16 May 2017 19:31:24 +0200 Subject: [PATCH 2/2] sh-clk: Delete an error message for a failed memory allocation in two functions From: SF Markus Elfring To: linux-sh@vger.kernel.org, Rich Felker , Yoshinori Sato Cc: LKML , kernel-janitors@vger.kernel.org, Wolfram Sang References: Message-ID: Date: Tue, 16 May 2017 19:31:20 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.1.1 MIME-Version: 1.0 In-Reply-To: Content-Language: en-US X-Provags-ID: V03:K0:BMiJbYU3gqX22RwMps/HrdQIyC2Ah+OajdiXS5QYzxlcu32auTf 3qiA0I7Ar+sb7k0gyCVgciYZ5jh1FCd2t5kGL3f9QHVL+moKUz/W/PSaQ1lUH+UdEnRpXXN IbS+nGKfXTnLOp0T4Kpu59onpAlnb43SJbr/YRnKfXrQEwszcyv5iv6Hc6Ihjvfm43Mxc/9 a6r4fNNYF0eBT4tCOOZew== X-UI-Out-Filterresults: notjunk:1; V01:K0:r21stbCyZeE=:oqGJbpplgtQrcolG/nApLq fB3goXY7i4oqmF+SjfYaiRxhPIIuZ+vpABA1pCIIvfY4yR0bVgOa3bZj3Oy0JLych94cF8+Q0 6LK/pP0vffHteF7NqRXUbawYwDgKseRYbQxKp10aSze8rgAubtnJf/v211h52Lh71JZOuRQCq feF6WCnFIfYJM4mqEuDbSVERGVxxZuygXUSt9EDQj9PjrL81lfwWSbg/Hrnktr67QJdy3WL46 RTZ2uxMxqQHyOKpd5uNP62hpp5bEcs7NkHLqLFAWsSu4iAj4EOSZ+PETeeLEgmEGwweHyYI97 Okj+XcFcnk25tG5BVa0w0FszmDuI0kcopqi8ID7JpaplxVNLpGG2FECM0ujMvKkn/xbsEsi3/ 5/yHxRCOap2SHbEhDxWqg0thdc+qbOWJcNXLs0lSlpPhKnAizXJ4/lqembRT81xquruUHeWNT 1JoATb6LYy9yjoGTv6O+88xAmGjb1IprRD/6HRlggrK6qMJdTgMKd0jgRpHBqcYp07BjYLvVh mFp/zTeyndfat2BAXlhS22uk2e8zFeOW3OhHlv8+C8j5b/I/7dWBKojOSkfoX1Kz/JY4L5RaS lJLyhVjiPhOqDO/z7kpqz1+6eQSHxZ77zqjffrPI/GmGRFf6bvnM/J3ApI6/DCsUq5brUD0hu sYguVQhm8Mb8FwvoNHmLv4ppRTwBjbd2Uhyi3eI2/TrH7mC26IjeQCeLK97wFUIe/psSGjytZ j9ngywFVFR1D9Y4arACcmHbDkEZI9WT/jaJK+BS6GpO7jqs5sWAdVxSRLrsixbmvrbWIfIsKW 2rxmGiB Sender: linux-sh-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-sh@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Markus Elfring Date: Tue, 16 May 2017 19:05:36 +0200 Omit an extra message for a memory allocation failure in these functions. This issue was detected by using the Coccinelle software. Link: http://events.linuxfoundation.org/sites/events/files/slides/LCJ16-Refactor_Strings-WSang_0.pdf Signed-off-by: Markus Elfring --- drivers/sh/clk/cpg.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/drivers/sh/clk/cpg.c b/drivers/sh/clk/cpg.c index f23464bbeb7c..b3afe5c4fa3b 100644 --- a/drivers/sh/clk/cpg.c +++ b/drivers/sh/clk/cpg.c @@ -253,7 +253,5 @@ static int __init sh_clk_div_register_ops(struct clk *clks, int nr, - if (!freq_table) { - pr_err("%s: unable to alloc memory\n", __func__); + if (!freq_table) return -ENOMEM; - } for (k = 0; !ret && (k < nr); k++) { clkp = clks + k; @@ -474,7 +472,5 @@ int __init sh_clk_fsidiv_register(struct clk *clks, int nr) - if (!map) { - pr_err("%s: unable to alloc memory\n", __func__); + if (!map) return -ENOMEM; - } /* clks[i].enable_reg came from SH_CLK_FSIDIV() */ map->phys = (phys_addr_t)clks[i].enable_reg;