From patchwork Wed Oct 12 14:52:35 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: 9373365 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 6068A60487 for ; Wed, 12 Oct 2016 15:01:17 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 51FCF28459 for ; Wed, 12 Oct 2016 15:01:17 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4663829DB2; Wed, 12 Oct 2016 15:01:17 +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 E0320284BD for ; Wed, 12 Oct 2016 15:01:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933825AbcJLPAz (ORCPT ); Wed, 12 Oct 2016 11:00:55 -0400 Received: from mout.web.de ([212.227.15.3]:55487 "EHLO mout.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755170AbcJLO7Y (ORCPT ); Wed, 12 Oct 2016 10:59:24 -0400 Received: from [192.168.1.2] ([78.49.9.22]) by smtp.web.de (mrweb003) with ESMTPSA (Nemesis) id 0Lylol-1ap54k1QRD-016BI8; Wed, 12 Oct 2016 16:52:37 +0200 Subject: [PATCH 14/34] [media] DaVinci-VPFE-Capture: Delete three 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: Date: Wed, 12 Oct 2016 16:52:35 +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:By9YVeYso/7yZ1BWQheDGMH0Bf8qvnEMiQ154t4wrRI16ZO6PAa Ds24RYilvv1EdgkUvMqIcc6HteW074CQCkaZpCL/t/94B52Lp7jujMt/ZaWpd7erHlYCxQw B6gGza/8bPk2ESpIam/l8puDOsN1cA2yaLaKwK6d87SN6cFM+jZ3MOxP6nm55WyT9ruogz0 x9v6ZWPtrV82sjhmxE0OQ== X-UI-Out-Filterresults: notjunk:1; V01:K0:F3cg9fO3G34=:UMc991NVSKcABezNF/4SPB SJIdHZ+mnS4DgVWx2GG0QzEZW/FdhINl54Y7oZPWPK96r+3t4DcKok5AMno/nQ8c13SLSG/DF vvWe/b4HxoU4PLXaSkaABaif5JSKMNj9k3xeQczc0ru+EJXNhAauVG8x22h3f2XhwgmJJp4Jd wZ3H071gq/B9TXKqBLleGvboTtpu7uXJrUb6b2/QY+cPbMsYyZLbEIKQj7f5ScubThqtGAqHu 3e9cKmR/LSrmNB3GTmfhC4GgC0Xi2wCeNbop0Df26y5jY6jd2uGx7s/OOpG1KXBr4QE8kLEov wW/pRGhGU8kQBZHmXLZJdLeoHZyOUbmmuAbhO8ZJ7Ug3IKflRsURs1+/WmKSMRNJN+5OtWokQ C2MDa9avCl3FXkVqjeaDZ+Zv3tP6Fym5xgSA0wvmuQe7Bo3nhJh2kRU8QODCUvqSg/a0B3LJv dYyLGpQK7CmgkScgzvdNP/YrjtaZw+JthTqDOhtvyBISDdhfQjEHGgf0aIk2i1NCN7YiyUXEw 1lrEcb7aKYrnFoZFrMe565UiIeMAbSAa2oEhJvT/icyvCiRmFc2DFO1HtdBeNc9AxoVvt/aMP bMisdb2OmoM3fjKnkgMtdRJSho2WZAQ0sGxAyyIGpdlcu828r25cHXRiDgseikCsvtd3nOF+G LZ0CZ3fmRZBBWcNjXs8f9Bx8tZd4OGWFDPqFGxHD2M79lb0gRlp7CUzdx7lVd0OIzZHwD4UVY l/GIBLx0sq8pbI/cxt72KST3uCk+s+P0wTE7SJA602eNCvlNMKXuMrNOKEX2GGGfZU3Sc1CsZ tVu8Jb4 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: Wed, 12 Oct 2016 10:22:47 +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/vpfe_capture.c | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/drivers/media/platform/davinci/vpfe_capture.c b/drivers/media/platform/davinci/vpfe_capture.c index 5c1b8cf..23142f0 100644 --- a/drivers/media/platform/davinci/vpfe_capture.c +++ b/drivers/media/platform/davinci/vpfe_capture.c @@ -512,11 +512,9 @@ static int vpfe_open(struct file *file) /* Allocate memory for the file handle object */ fh = kmalloc(sizeof(struct vpfe_fh), GFP_KERNEL); - if (NULL == fh) { - v4l2_err(&vpfe_dev->v4l2_dev, - "unable to allocate memory for file handle object\n"); + if (!fh) return -ENOMEM; - } + /* store pointer to fh in private_data member of file */ file->private_data = fh; fh->vpfe_dev = vpfe_dev; @@ -1853,11 +1851,8 @@ static int vpfe_probe(struct platform_device *pdev) /* Allocate memory for ccdc configuration */ ccdc_cfg = kmalloc(sizeof(struct ccdc_config), GFP_KERNEL); - if (NULL == ccdc_cfg) { - v4l2_err(pdev->dev.driver, - "Memory allocation failed for ccdc_cfg\n"); + if (!ccdc_cfg) goto probe_free_dev_mem; - } mutex_lock(&ccdc_lock); @@ -1944,8 +1939,6 @@ static int vpfe_probe(struct platform_device *pdev) sizeof(*vpfe_dev->sd), GFP_KERNEL); if (NULL == vpfe_dev->sd) { - v4l2_err(&vpfe_dev->v4l2_dev, - "unable to allocate memory for subdevice pointers\n"); ret = -ENOMEM; goto probe_out_video_unregister; }