From patchwork Wed Oct 12 14:30:28 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: SF Markus Elfring X-Patchwork-Id: 9373281 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 CAFBA60772 for ; Wed, 12 Oct 2016 14:31:16 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id BBA6F29610 for ; Wed, 12 Oct 2016 14:31:16 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id AF88929612; Wed, 12 Oct 2016 14:31:16 +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 0DA1C29612 for ; Wed, 12 Oct 2016 14:31:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933628AbcJLOaw (ORCPT ); Wed, 12 Oct 2016 10:30:52 -0400 Received: from mout.web.de ([212.227.15.14]:57884 "EHLO mout.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933602AbcJLOao (ORCPT ); Wed, 12 Oct 2016 10:30:44 -0400 Received: from [192.168.1.2] ([78.49.9.22]) by smtp.web.de (mrweb003) with ESMTPSA (Nemesis) id 0M4ZVE-1avuuH1Zoy-00yjDB; Wed, 12 Oct 2016 16:30:29 +0200 Subject: [PATCH 02/34] [media] DaVinci-VPBE: Delete two error messages for a failed memory allocation To: linux-media@vger.kernel.org, Hans Verkuil , "Lad, Prabhakar" , Mauro Carvalho Chehab References: Cc: LKML , kernel-janitors@vger.kernel.org, Julia Lawall , Wolfram Sang From: SF Markus Elfring Message-ID: <664f2619-1c7c-22de-775e-3af16e4203f8@users.sourceforge.net> Date: Wed, 12 Oct 2016 16:30:28 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.4.0 MIME-Version: 1.0 In-Reply-To: X-Provags-ID: V03:K0:X/u8lNuVCBNG1VCYBadL7OSU+wWaVVA2yn6IhjgVCgzEwhC5E0J d52u1HJYnVliwvzDQqTaMThM9fidmS2HSzdkMELWt5Zh0pkP9FzUNPj5YNbjtjyqwBVg/fF 8TTbkYuz9jsUhxqL6isyo/aeKzfVfq7O7huSga5iraGE2w1j70Zd/L9hN5SAG5RoT2TpB3m pZifSlY2+bEwlQX+eBNgA== X-UI-Out-Filterresults: notjunk:1; V01:K0:J4DDHa5wWwQ=:3dO1QLpgxsCXDQIoUV3BDi NpOw0oIMmDsDIWipjw3o123XTpWP9m6czq3yL+wgDqmvfXQdrPamaE4+2ZnNgfxRm7SQBZ+xD AkisH1mNx752wf+an5Pu4j6ml3Ckz+bnSvVH7JWpE+wE7Htx7N5SMMSpIdoWp3+yfgKNbQZOE PzZTX/Im3TVGscHgTC/x41TgLT7ECr2ftdOEVdPddXIM9TUHY7g9QPzZmXGJVCydnLcg9fNyA 2u+Mv5/IB2L1Ah/51qWu0YBn9Kf1xwHJM37HHBS8C2ISTuoA9xon5UwOFITvyXsJUBoxpVlsW 2OircuF2zsmNwq4Az+vtUpplQjX8s2dCitk1TTtxiV/pTE70JwW6ZC2rcPIwvC5Z29c77gxh/ ypqCZBRYkRQnbI7Uw05At2ZgwA2Z5hGbrLF7BLCDyArvDc1d8fUAZ6jk3iONk7QKb94easVAt hIqzmsLRysaTw8Psh9CRDnStM2qC0GeaTbMKgwDHR/IBel/zYCw25jjDMfc7zCmB11YfsF5nU vanggJCl0IpL8+TshKsgpRFzH2ykmi5AehfY9nC0Hsq1VRn2FkTWTIL8EY9Er9AqZ5+5bcH4Q Yuyiv67S9aL37FJWLnQumIQzL3djD/gQB70HHgdhuC03hxAlNCUz4qoUl5KRn3g4g6zVDD2/i tgbdqLOaZHhiV2dMpVCAf4B02OOOf8ViwUfIF778jLcdDya0vVvag2pvVtynEy2hwCPnxoHwP dpxGbzkMVNY50YYQAT5O08emEDsnviVkd2tvryLlGCIWS0V1mKJEwu7UXLMTc4u+cSPRvE4SD q5ytR8l 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: Tue, 11 Oct 2016 09:56:13 +0200 The script "checkpatch.pl" pointed information out like the following. WARNING: Possible unnecessary 'out of memory' message Thus remove such a logging statement in two functions. Link: http://events.linuxfoundation.org/sites/events/files/slides/LCJ16-Refactor_Strings-WSang_0.pdf Signed-off-by: Markus Elfring --- drivers/media/platform/davinci/vpbe.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/drivers/media/platform/davinci/vpbe.c b/drivers/media/platform/davinci/vpbe.c index 8c062ff..b479747 100644 --- a/drivers/media/platform/davinci/vpbe.c +++ b/drivers/media/platform/davinci/vpbe.c @@ -680,8 +680,6 @@ static int vpbe_initialize(struct device *dev, struct vpbe_device *vpbe_dev) sizeof(*vpbe_dev->encoders), GFP_KERNEL); if (NULL == vpbe_dev->encoders) { - v4l2_err(&vpbe_dev->v4l2_dev, - "unable to allocate memory for encoders sub devices"); ret = -ENOMEM; goto fail_dev_unregister; } @@ -841,11 +839,9 @@ static int vpbe_probe(struct platform_device *pdev) } vpbe_dev = kzalloc(sizeof(*vpbe_dev), GFP_KERNEL); - if (vpbe_dev == NULL) { - v4l2_err(pdev->dev.driver, "Unable to allocate memory" - " for vpbe_device\n"); + if (!vpbe_dev) return -ENOMEM; - } + vpbe_dev->cfg = cfg; vpbe_dev->ops = vpbe_dev_ops; vpbe_dev->pdev = &pdev->dev;