From patchwork Sat Jun 3 18:34:07 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: 9764473 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 86BAA602B6 for ; Sat, 3 Jun 2017 18:34:37 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7D3D6285C4 for ; Sat, 3 Jun 2017 18:34:37 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 71BAC285D9; Sat, 3 Jun 2017 18:34:37 +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 2002F2856A for ; Sat, 3 Jun 2017 18:34:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751156AbdFCSef (ORCPT ); Sat, 3 Jun 2017 14:34:35 -0400 Received: from mout.web.de ([212.227.15.14]:57093 "EHLO mout.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750991AbdFCSee (ORCPT ); Sat, 3 Jun 2017 14:34:34 -0400 Received: from [192.168.1.2] ([77.182.192.46]) by smtp.web.de (mrweb003 [213.165.67.108]) with ESMTPSA (Nemesis) id 0Md4le-1dYLJq24sk-00ICoC; Sat, 03 Jun 2017 20:34:08 +0200 Subject: [PATCH 8/9] ARM: OMAP2+: SmartReflex: Delete an error message for a failed memory allocation in two functions From: SF Markus Elfring To: linux-omap@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Russell King , Tony Lindgren Cc: LKML , kernel-janitors@vger.kernel.org References: Message-ID: <13210fb0-3a22-07f5-0bc5-b338b1ccfdeb@users.sourceforge.net> Date: Sat, 3 Jun 2017 20:34:07 +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-GB X-Provags-ID: V03:K0:yr8ybQvGRRhWZKIsgU+oZEC8fAtwhsl8bwyOkhzo7dFeKz8zunE kfzYuXKRklSxYS9P6+1AuthoruCJDR9ah4up16pW1ADxh4B65ndmVNw+xDzYpPi+IdG/jtp fRTb2cn5LRGYhzLVIL3+Lwpb3Lq9hoTiK4hYSzIaKNBK9Jw9xuQQjEZTIuzJlTt3rhYcvwg IPB4ou4POV/cl9hdPkZcg== X-UI-Out-Filterresults: notjunk:1; V01:K0:k02NqdAQVYs=:OMUzduL1NRiDWlS0QAazMv CCJt4LRtt9joIlW42uFp4d/uGNWwobmii/ySQ4kUukTcENpRtymXTPH/LVtF/VzBtZopo9iu7 2LxzOnoG05f5yp7D5Xf+0VVBETBPn7ZLuP5D5R9FGvyxupM6Y5a+doK8aLOpFLWwq2VBOxDd0 lvgP0ZRxHG6yagVWK5Cqt1SAqyxq6N9pbla+R/iSPy/GhuSHpeaBZibAOjHQyE9ax7J2u0wjL Q3trOMdYcLNQSDHJfJH43iefivgzaZFaYiEAQg3sdGWkfM/guk5e71o3WVlwTxNxAtSurdH/t PNZEinEVLoZEsG29WS7TESzdWTohCTG9UoFRGm0UCwiiMDxJ4ZWo+hEp2cdG3CrZY8wcgNmQA k7e0fQ/NgTyGRyUnlFZOV3BnDehK1BkTFBD1fX/quG51dh5Cbn48tQesfSRaoknLkF1yt/+bN tIeLCMLiKqfLGdPi9Ld+0NU1IjGS/h46H1MmuyQog5VZCd+JW7ObdB+sa6YLsDhvEgqJlr+xW IQZ7ySMDGzlhIwFMN8h2LuD2YrJnB22uAaUerBggUCx/Kc7XCs0IEG4/Z13NTGvpOZ9Y8mSwn kujHDhWY3vvU6nZnjy3SKxmqin8BGs1slIlvBGyEgoppQ36iEengqlC7DWr83zUyt3H2MS5wx IUOU4/Q8ehrslQWGZbiINGldPJjEkhC44VEB7Vl1DhfFb2T8HsAe+4g7rJLYrK80xLxdiDaZk 9TPqKz1KGUOkkckE1OSeXYWM9vgU2QPiGGZQNhnjTVahnRZIOsq5YzE0BpJGxtPh3h3b2+qc8 nfekIgi Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Markus Elfring Date: Sat, 3 Jun 2017 19:16:27 +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 --- arch/arm/mach-omap2/sr_device.c | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/arch/arm/mach-omap2/sr_device.c b/arch/arm/mach-omap2/sr_device.c index 65775c6e8c27..eef6935e0403 100644 --- a/arch/arm/mach-omap2/sr_device.c +++ b/arch/arm/mach-omap2/sr_device.c @@ -48,7 +48,5 @@ static void __init sr_set_nvalues(struct omap_volt_data *volt_data, - if (!nvalue_table) { - pr_err("OMAP: SmartReflex: cannot allocate memory for n-value table\n"); + if (!nvalue_table) return; - } for (i = 0, j = 0; i < count; i++) { u32 v; @@ -104,8 +102,5 @@ static int __init sr_dev_init(struct omap_hwmod *oh, void *user) - if (!sr_data) { - pr_err("%s: Unable to allocate memory for %s sr_data\n", - __func__, oh->name); + if (!sr_data) return -ENOMEM; - } sr_dev_attr = (struct omap_smartreflex_dev_attr *)oh->dev_attr; if (!sr_dev_attr || !sr_dev_attr->sensor_voltdm_name) {