From patchwork Thu May 18 20:30: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: 9735219 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 7DACB601C8 for ; Thu, 18 May 2017 20:30:23 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6292D28778 for ; Thu, 18 May 2017 20:30:23 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 535862888E; Thu, 18 May 2017 20:30:23 +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 BA51928778 for ; Thu, 18 May 2017 20:30:22 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753775AbdERUaV (ORCPT ); Thu, 18 May 2017 16:30:21 -0400 Received: from mout.web.de ([212.227.15.3]:52395 "EHLO mout.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752483AbdERUaU (ORCPT ); Thu, 18 May 2017 16:30:20 -0400 Received: from [192.168.1.3] ([78.49.18.34]) by smtp.web.de (mrweb001 [213.165.67.108]) with ESMTPSA (Nemesis) id 0MRl2f-1da2Om0Zir-00SudU; Thu, 18 May 2017 22:30:09 +0200 To: linux-pm@vger.kernel.org, linux-omap@vger.kernel.org, Eduardo Valentin , Keerthy , Zhang Rui Cc: LKML , kernel-janitors@vger.kernel.org, Wolfram Sang From: SF Markus Elfring Subject: [PATCH] ti-thermal-common: Delete an error message for a failed memory allocation in ti_thermal_build_data() Message-ID: Date: Thu, 18 May 2017 22:30:07 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.1.1 MIME-Version: 1.0 Content-Language: en-GB X-Provags-ID: V03:K0:VqiumWC/ewWofEC6Oeetpxr2PQjVaSXxz+A0FoNrGesXCpkE2iB 5DONfJlrKa2W+S+dO++P7DlXUIN0NL37W1IYYrIIpwh6iOrg1zMb8cg7p3eFRdz1t26BwqX 7G+J+GyIhigEevlJRYlXaccip5Vl6e8cu1IbWr1G7/gOqKoM0HndAQYfz0YAuFK325hKaam cYDe4KiNwyihTEgMD8LsA== X-UI-Out-Filterresults: notjunk:1; V01:K0:YHRea0EneO4=:UZZ1BMFU+MCwQ46ODDNw80 xuMfmuSmVzTxT8cxh8pMLZljqkFlIFVn2WUrMBIT2qXsFQLrOzNJbLZdcsyQTPvGBofMMReox UxVBA/tchSj/gfpUJmCmRdVQrf1eXfJvvAW1kbGZdLEf5ADBFes7kWoiYwqclbvdLjHYufzfr MzpSadw2HxY5qc50WR9bou8J8Cq9aTHVKmS92QrNN2fMuZZRYDI+p970CME2PNsDIMUZVwuIW G+DBtI/R4d1VTsoeoMQxmBvJ32MEIMGL3FFGAsxuUdQRHikI8GEbVHf7Pd2LtfM3uCgh27xXB WVeABVa18dRRN+X6fcshXhlXLLoexvJ5XU0jKntvCWuysjkX6rcDiXDpxYilS4SACo9Cs2vZF vcD740c9UxHQ5Vh9Qkq9S8B67FaaFqp78vYGdjlnuIfJa5svEWmcFHriqWAGzquoyWT3zIXOZ i+VJBHpEeARsuXj0XlnVP5QHPcHxGlLhknpPt1CQvBFJfY2nGt+Ugx2YMHmgWHvBX6ZHFE2IY BK8Ixu73OHAGkct9TlN/FgIekIa/Fset19zh6qdpR5YDw+SgO9u+0gameWCftRXuCoFhT+O+g CoZ2BBHOZ44f4Mi9qLpPItKcqlFnjXjWfMiB00xQHHyC23/Gn2f1BtY3hJAeBnPs15KKHvryo TZGJJC5VhxaBlF80iOnVjHCcqHibQz9chCnsUtNhqWeY/LTqQlLQXQ4Y1UaOj2jjjkTrFr1A3 kPb6mSp0px0qrWR/lk5y4GPHHGu+LNaRIpbwk3BIjCb/AA2AX8OwUjaY/gw0miV8b70pAsUiA Ih0buac Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Markus Elfring Date: Thu, 18 May 2017 22:20:12 +0200 Omit an extra message for a memory allocation failure in this function. 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/thermal/ti-soc-thermal/ti-thermal-common.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/thermal/ti-soc-thermal/ti-thermal-common.c b/drivers/thermal/ti-soc-thermal/ti-thermal-common.c index 02790f69e26c..5d29aa35cc34 100644 --- a/drivers/thermal/ti-soc-thermal/ti-thermal-common.c +++ b/drivers/thermal/ti-soc-thermal/ti-thermal-common.c @@ -160,10 +160,9 @@ static struct ti_thermal_data struct ti_thermal_data *data; data = devm_kzalloc(bgp->dev, sizeof(*data), GFP_KERNEL); - if (!data) { - dev_err(bgp->dev, "kzalloc fail\n"); + if (!data) return NULL; - } + data->sensor_id = id; data->bgp = bgp; data->mode = THERMAL_DEVICE_ENABLED;