From patchwork Sat Sep 16 18:31:42 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: 9954435 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 5940B601C0 for ; Sat, 16 Sep 2017 18:32:18 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4769628EE4 for ; Sat, 16 Sep 2017 18:32:18 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3889628E94; Sat, 16 Sep 2017 18:32: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=unavailable 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 DF96F28E94 for ; Sat, 16 Sep 2017 18:32:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751455AbdIPScD (ORCPT ); Sat, 16 Sep 2017 14:32:03 -0400 Received: from mout.web.de ([212.227.15.14]:62979 "EHLO mout.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751297AbdIPScC (ORCPT ); Sat, 16 Sep 2017 14:32:02 -0400 Received: from [192.168.1.2] ([78.48.47.134]) by smtp.web.de (mrweb002 [213.165.67.108]) with ESMTPSA (Nemesis) id 0Lb1nV-1d8uZy0m7t-00kgUa; Sat, 16 Sep 2017 20:31:43 +0200 Subject: [PATCH 1/2] [media] it913x: Delete two error messages for a failed memory allocation in it913x_probe() From: SF Markus Elfring To: linux-media@vger.kernel.org, Antti Palosaari , Mauro Carvalho Chehab Cc: LKML , kernel-janitors@vger.kernel.org References: <0ad553a6-9aca-d20b-48df-4084d80e2223@users.sourceforge.net> Message-ID: Date: Sat, 16 Sep 2017 20:31:42 +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: <0ad553a6-9aca-d20b-48df-4084d80e2223@users.sourceforge.net> Content-Language: en-GB X-Provags-ID: V03:K0:zhDFeZ6Zc33hW6xzDj7pO/2VwyWdVg+Kp2PDDqQDhiTGAWGS+9u jfTGP9cSTdow0XXX6+C1lYAMaJ7bMrgTuFPQesqhZ3p7X0wB9d1yGA3VDxUxIGrUHevSYbh RUTu6vilMRHzLGlSq3sk6IEzwOtrxASoYnxKaJoI1YOkuNBs0C4Gcl8DAfr1ij2QEjlYJTW fPs6+GXLONCdMKAvYnk2g== X-UI-Out-Filterresults: notjunk:1; V01:K0:LZVaQmK7fRE=:GGhtE6hd4nOcqJS30MFh+/ wShDCN5mm8cGnZXh7fXrpcIBOXhkoC5LhMUSadr/lcrvs2Z+2BNGa0Aena7OboZforNGL8eb3 ykBsmNnuMSnc4m6lPDdGxTmo60kiC3Q0ZSbd0e6TNjKvtA48wIsB1X7m3PPPBbPZXEzWvIVGv u3AjSmgg45AvXPh9cavaXcmO7D7nwMaUXegyzpyzHjP4dgdX36G7AmCWkOi+BYfa+plSzHI4b w+WGxXjD7dHw2LhX6EMNU3pOL3WdPJZyQt5WRiwXd3wlkM+HiHm1IQFUnguRIKmGQ4/74kZpU IDmhJ4KFFW5r7YjmSFlbn0bGQwyVZRMDWTYtAMRXEzu1Dbxmbl6AT3AYFkWkhLZz2nIO7ZE5H KkEeAHoHELl8BJ3UjEmdwGTGe9zCiPhYuDaDwYtA6JK+n4RkPdZvm1maUFofhwy47wyqOGZ9B +h89WG/g9qKSW8jgwFzRnqPLvpSNVYj4M8OGn3LWp6jrRDQPXbs+t/fFHnwGCsWjSkcz4r5Dc S5Z69TwxnA7VwzD8uD2J/1H561WdcQNpyxM/GMMKWdPH6ScMFx1VQjPnHw1dZ0fdUlejmKzm5 0SyN3N0PG18pqz0FiwH1H1wCiwyvC2Ys5jalcmxpvMRQhpP3Ci/prwsavH0KY0JX9yvJVQXOt R5le/rktypOoxiIesrbcUAZIz8ipmQ3nkB68YwIW9BuMF1iKrCqyhJKrLjM3cSztxHydWF/IX 43cSd5ZueU40Lz46a6apyIDDaV6x+9d7QOQBThwYBWSFkwTyE0Dr/H+Pzy49ZRq+CyysceFDs NjsaShZaZ04o9/5Cqsw7qiYQp51SuPtah/aQthOZBhMvDeOt24= Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Markus Elfring Date: Sat, 16 Sep 2017 19:40:47 +0200 * Omit extra messages for a memory allocation failure in this function. This issue was detected by using the Coccinelle software. * Delete the label "err" and the variable "ret" which became unnecessary with this refactoring. Signed-off-by: Markus Elfring --- drivers/media/tuners/it913x.c | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/drivers/media/tuners/it913x.c b/drivers/media/tuners/it913x.c index 27e5bc1c3cb5..6af9507823fa 100644 --- a/drivers/media/tuners/it913x.c +++ b/drivers/media/tuners/it913x.c @@ -392,14 +392,10 @@ static int it913x_probe(struct platform_device *pdev) struct it913x_dev *dev; const struct platform_device_id *id = platform_get_device_id(pdev); - int ret; char *chip_ver_str; dev = kzalloc(sizeof(struct it913x_dev), GFP_KERNEL); - if (dev == NULL) { - ret = -ENOMEM; - dev_err(&pdev->dev, "kzalloc() failed\n"); - goto err; - } + if (!dev) + return -ENOMEM; dev->pdev = pdev; dev->regmap = pdata->regmap; @@ -423,9 +419,6 @@ static int it913x_probe(struct platform_device *pdev) chip_ver_str); dev_dbg(&pdev->dev, "chip_ver %u, role %u\n", dev->chip_ver, dev->role); return 0; -err: - dev_dbg(&pdev->dev, "failed %d\n", ret); - return ret; } static int it913x_remove(struct platform_device *pdev)