From patchwork Sun Sep 24 18:04:51 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: 9968121 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 91342602B9 for ; Sun, 24 Sep 2017 18:05:09 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 85D3528C56 for ; Sun, 24 Sep 2017 18:05:09 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 7213628C61; Sun, 24 Sep 2017 18:05:09 +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 28B9D28C56 for ; Sun, 24 Sep 2017 18:05:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752742AbdIXSE6 (ORCPT ); Sun, 24 Sep 2017 14:04:58 -0400 Received: from mout.web.de ([212.227.15.3]:63992 "EHLO mout.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752624AbdIXSE5 (ORCPT ); Sun, 24 Sep 2017 14:04:57 -0400 Received: from [192.168.1.2] ([78.48.160.4]) by smtp.web.de (mrweb003 [213.165.67.108]) with ESMTPSA (Nemesis) id 0MFL64-1e8EVM1VJc-00EPxN; Sun, 24 Sep 2017 20:04:52 +0200 Subject: [PATCH 1/4] [media] omap3isp: Delete an error message for a failed memory allocation in three functions From: SF Markus Elfring To: linux-media@vger.kernel.org, Laurent Pinchart , Mauro Carvalho Chehab Cc: LKML , kernel-janitors@vger.kernel.org References: <692bab24-7990-c971-b577-b2dea4176e64@users.sourceforge.net> Message-ID: Date: Sun, 24 Sep 2017 20:04:51 +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: <692bab24-7990-c971-b577-b2dea4176e64@users.sourceforge.net> Content-Language: en-GB X-Provags-ID: V03:K0:zgIEu2UmjswiTYI19SVbZAeEQMNHlaatLzKBIs3MuzBb+VV8Llc /IzI4hSxulWokHdObAtr7Bkx6JOQIwwWIi1e0niPY8rCmPthjS8+GnpPZDmd7Vve8nII57T QliS6v56VJJbQbgyq8KVbcMbwkRNay+nLe3EnjKtlnEJX2ELt4WVfIj8y095JavHMkAQrtt N9nrwZ5U3QuA3j0OoC3jg== X-UI-Out-Filterresults: notjunk:1; V01:K0:55/jm5jQf40=:Zv1A/zQ753Xv25RP7kw9l1 dMfkTWvPLG2tvNiv2ctU3tRF6LRMyNIizBWadVhKsWM7/qKiFpShmjKGq6vtcFz/4cTy3gFrW QuHo9Dlg2z2kfnxTeay9v8hV+JioHD7ksp1NuFiJZ9aC+E4xE/JSPxv5VRTIg69Tm6rQXruSG R1a/2almJVAtIEIKvw0LWYL+XZsv6Mgdhl6ZT1pUSOd5qxBP4GYda5s/8UisXBug5o0UGlEOC dXFltiQ3hg1dIAUtZWZcCgSxFtikn5U13OPGzfiM5/WLdp1DOY27Tf7Ft5Vty4HhMmZGURSC5 +Ey7DhWzKU63Gj5jngZG8QdIVwIb6KQx6YfTlh4ZjmatuSKQ7T5Nie62bLIJ2/vNzFhkqmRix yM1ZW8jaJvQHXpi4UtLwwvReqWXelxcFeUmtLbZvMgGmlrNCRs2djLGKzp5imGb5WLDopVHea b2JcuBohxGJyLyWYFrC/0VV7CbeZl+PHPwi7wJSB8zhsCoK+Vbh2yZdz1yfdXJPMRwnNT8EKn UYBECYK0O4oY9VoX/M02Za+KwsZaJuzwWEEXVymwemnC+RmuGDJWFDSNJEgZ+OYXxn4HXnw6j WGHhA3+vpdPBu9MJWx6tPmVJQEBlK1DvehuCeUwT9jBJ8921bs84sxMOHF1d5oQWlIFe5PCbm /rb+DEZn77a9YMxS47dRUYSUbOtwWPy8oCOJqjyNpjf9xbuyFuYC3M9aSeajmRJc7b7htItj+ 6Ha7Ysr1Nt0iLhewdk/oJilk4PdX1c0Non7RE2sS08dR6z15xT68vHScmmvwn9JIurIZvnYTE 1cASNhwxCLqLEwgo477Wpgw+DFVmBoQpCDX/jqmk5vuuFo0e30= 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: Sun, 24 Sep 2017 18:25:44 +0200 Omit an extra message for a memory allocation failure in these functions. This issue was detected by using the Coccinelle software. Signed-off-by: Markus Elfring --- drivers/media/platform/omap3isp/isp.c | 4 +--- drivers/media/platform/omap3isp/isph3a_aewb.c | 5 +---- drivers/media/platform/omap3isp/isph3a_af.c | 5 +---- 3 files changed, 3 insertions(+), 11 deletions(-) diff --git a/drivers/media/platform/omap3isp/isp.c b/drivers/media/platform/omap3isp/isp.c index 1a428fe9f070..874b883ac83a 100644 --- a/drivers/media/platform/omap3isp/isp.c +++ b/drivers/media/platform/omap3isp/isp.c @@ -2236,10 +2236,8 @@ static int isp_probe(struct platform_device *pdev) int i, m; isp = devm_kzalloc(&pdev->dev, sizeof(*isp), GFP_KERNEL); - if (!isp) { - dev_err(&pdev->dev, "could not allocate memory\n"); + if (!isp) return -ENOMEM; - } ret = fwnode_property_read_u32(of_fwnode_handle(pdev->dev.of_node), "ti,phy-type", &isp->phy_type); diff --git a/drivers/media/platform/omap3isp/isph3a_aewb.c b/drivers/media/platform/omap3isp/isph3a_aewb.c index d44626f20ac6..9844b9d06634 100644 --- a/drivers/media/platform/omap3isp/isph3a_aewb.c +++ b/drivers/media/platform/omap3isp/isph3a_aewb.c @@ -303,11 +303,8 @@ int omap3isp_h3a_aewb_init(struct isp_device *isp) /* Set recover state configuration */ aewb_recover_cfg = devm_kzalloc(isp->dev, sizeof(*aewb_recover_cfg), GFP_KERNEL); - if (!aewb_recover_cfg) { - dev_err(aewb->isp->dev, - "AEWB: cannot allocate memory for recover configuration.\n"); + if (!aewb_recover_cfg) return -ENOMEM; - } aewb_recover_cfg->saturation_limit = OMAP3ISP_AEWB_MAX_SATURATION_LIM; aewb_recover_cfg->win_height = OMAP3ISP_AEWB_MIN_WIN_H; diff --git a/drivers/media/platform/omap3isp/isph3a_af.c b/drivers/media/platform/omap3isp/isph3a_af.c index 99bd6cc21d86..b81e869ade8c 100644 --- a/drivers/media/platform/omap3isp/isph3a_af.c +++ b/drivers/media/platform/omap3isp/isph3a_af.c @@ -366,11 +366,8 @@ int omap3isp_h3a_af_init(struct isp_device *isp) /* Set recover state configuration */ af_recover_cfg = devm_kzalloc(isp->dev, sizeof(*af_recover_cfg), GFP_KERNEL); - if (!af_recover_cfg) { - dev_err(af->isp->dev, - "AF: cannot allocate memory for recover configuration.\n"); + if (!af_recover_cfg) return -ENOMEM; - } af_recover_cfg->paxel.h_start = OMAP3ISP_AF_PAXEL_HZSTART_MIN; af_recover_cfg->paxel.width = OMAP3ISP_AF_PAXEL_WIDTH_MIN;