From patchwork Wed Oct 12 17:16:15 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: 9373613 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 2727E60487 for ; Wed, 12 Oct 2016 17:17:46 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 13F3429395 for ; Wed, 12 Oct 2016 17:17:46 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 08981293E2; Wed, 12 Oct 2016 17:17:46 +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 CFC03293A8 for ; Wed, 12 Oct 2016 17:17:44 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755818AbcJLRRM (ORCPT ); Wed, 12 Oct 2016 13:17:12 -0400 Received: from mout.web.de ([212.227.15.3]:52841 "EHLO mout.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755427AbcJLRRE (ORCPT ); Wed, 12 Oct 2016 13:17:04 -0400 Received: from [192.168.1.2] ([78.49.9.22]) by smtp.web.de (mrweb002) with ESMTPSA (Nemesis) id 0MTPvz-1bSUJb1Dsd-00SNt0; Wed, 12 Oct 2016 19:16:16 +0200 Subject: [PATCH resent 27/34] [media] DaVinci-VPIF-Capture: Adjust ten checks for null pointers To: linux-media@vger.kernel.org, Hans Verkuil , "Lad, Prabhakar" , Mauro Carvalho Chehab References: <73a8bc6c-3dc5-c152-7b59-fd1a5e84f61c@users.sourceforge.net> Cc: LKML , kernel-janitors@vger.kernel.org, Julia Lawall From: SF Markus Elfring Message-ID: Date: Wed, 12 Oct 2016 19:16:15 +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: <73a8bc6c-3dc5-c152-7b59-fd1a5e84f61c@users.sourceforge.net> X-Provags-ID: V03:K0:Dbpimq0REEdY5HKQA1TQ/eHNuc5eP4s4W51OJQn4BCeTPnNQVHN NP1+pfm7BsCVnK0WaVPRUlwcPepUfEMWBLq81/Xfwt4vGGO6F3i3fqyEZtBcsYUYbdjRxC6 bDZss3TKQ2As8nuPpxXma4MxT4xdc3l8Ddor9w9uI51NTq1lEBAD7q1HnhOBipwoRJnDPGI uvRAF8fU8iXW1qa3LJIuA== X-UI-Out-Filterresults: notjunk:1; V01:K0:QodUUbmzeyg=:+3bh/m4CPDpLa7MvRp0wx+ BP+KLEd++W0RI1NAK+UMOmkDs3QdRXGCi/Akc6i8XnqqaGP+zGw+fEKSfO5FGOrf3M7jiUQfp tPwAfhVT2HlVxryUCYtjxUajiNivoX/B9isqMxIx2ShJUOc3Apd3Rr7Gulx+nHEvBIVffvsX2 uj2E02uANUn2Zy7nAgWnZNjSt956AAP/Nt9M2n2Ag1lOiQ5EMvrlKfCFeOxdOALT4aoijbJaf cEH2sADj59W8NWru261pnFGPypbUpl4YwFeZfLHqdjRlB3rklAd6BaLfwiWowW0pz7sXH908n 3a1FHArfZUjMkY7QxRsJJ9MHlys5D3eUyXunOTBCM1AfIfb47C4GrTu3lsLHnH+9KbpeMIGSF Q8/DJwmThsINW+7kSMDqQ36JohcnYCkbUcZknAFPrCSTlIwD2HZLcnpD4SiqiCiBnB55AgI42 2k1vMYc5mMRLPHK6OrUCqFsV1ujdTmvKv5Vol7WYXYeEt84vxWRg2WpxEckCVxmvOTM4aE41g f9qQ+tWPwoyFYH+0mI7FKchqAgzwI7VnTPF0iqzOd2Tt32Z2HtCqKuv+KchUo8KNzGsMDfVh5 bGvj+wS4OFu/9fDIcRGfa7d+mL0GXQ0zzRCgEoZdIrMMWmR0EFhbsXk6vZ3RwCl5x5nEsaRif K9iHndV8oKTPGO4a0xcSoIn/zrBuqTLYGtdELSwauMj8MTu74NCsVEHHeDDrjDOd+WDnwGwPZ fD2sbSXQPFvnar5vBf20D4tEjJIftsvDUBUKocmxPEDZZeKLjlWl+16jn8qLBGf+Gq/mPsePp MnppiIb 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 15:20:34 +0200 The script "checkpatch.pl" pointed information out like the following. Comparison to NULL could be written ... Thus fix the affected source code places. Signed-off-by: Markus Elfring --- Another send try because of the following notification: Mailer Daemon wrote on 2016-10-12 at 17:06: > This message was created automatically by mail delivery software. > > A message that you sent could not be delivered to one or more of > its recipients. This is a permanent error. The following address(es) > failed: > > linux-media@vger.kernel.org: > SMTP error from remote server for TEXT command, host: vger.kernel.org (209.132.180.67) reason: 550 5.7.1 Content-Policy reject msg: Wrong MIME labeling on 8-bit characte > r texts. BF:; S933375AbcJLPGr > > kernel-janitors@vger.kernel.org: > SMTP error from remote server for TEXT command, host: vger.kernel.org (209.132.180.67) reason: 550 5.7.1 Content-Policy reject msg: Wrong MIME labeling on 8-bit characte > r texts. BF:; S933375AbcJLPGr > > linux-kernel@vger.kernel.org: > SMTP error from remote server for TEXT command, host: vger.kernel.org (209.132.180.67) reason: 550 5.7.1 Content-Policy reject msg: Wrong MIME labeling on 8-bit characte > r texts. BF:; S933375AbcJLPGr drivers/media/platform/davinci/vpif_capture.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/drivers/media/platform/davinci/vpif_capture.c b/drivers/media/platform/davinci/vpif_capture.c index 24d1f61..d9fc591 100644 --- a/drivers/media/platform/davinci/vpif_capture.c +++ b/drivers/media/platform/davinci/vpif_capture.c @@ -291,10 +291,10 @@ static void vpif_stop_streaming(struct vb2_queue *vq) vb2_buffer_done(&common->cur_frm->vb.vb2_buf, VB2_BUF_STATE_ERROR); } else { - if (common->cur_frm != NULL) + if (common->cur_frm) vb2_buffer_done(&common->cur_frm->vb.vb2_buf, VB2_BUF_STATE_ERROR); - if (common->next_frm != NULL) + if (common->next_frm) vb2_buffer_done(&common->next_frm->vb.vb2_buf, VB2_BUF_STATE_ERROR); } @@ -648,7 +648,7 @@ static int vpif_input_to_subdev( vpif_dbg(2, debug, "vpif_input_to_subdev\n"); subdev_name = chan_cfg->inputs[input_index].subdev_name; - if (subdev_name == NULL) + if (!subdev_name) return -1; /* loop through the sub device list to get the sub device info */ @@ -764,7 +764,7 @@ static int vpif_g_std(struct file *file, void *priv, v4l2_std_id *std) vpif_dbg(2, debug, "vpif_g_std\n"); - if (config->chan_config[ch->channel_id].inputs == NULL) + if (!config->chan_config[ch->channel_id].inputs) return -ENODATA; chan_cfg = &config->chan_config[ch->channel_id]; @@ -794,7 +794,7 @@ static int vpif_s_std(struct file *file, void *priv, v4l2_std_id std_id) vpif_dbg(2, debug, "vpif_s_std\n"); - if (config->chan_config[ch->channel_id].inputs == NULL) + if (!config->chan_config[ch->channel_id].inputs) return -ENODATA; chan_cfg = &config->chan_config[ch->channel_id]; @@ -1050,7 +1050,7 @@ vpif_enum_dv_timings(struct file *file, void *priv, struct v4l2_input input; int ret; - if (config->chan_config[ch->channel_id].inputs == NULL) + if (!config->chan_config[ch->channel_id].inputs) return -ENODATA; chan_cfg = &config->chan_config[ch->channel_id]; @@ -1084,7 +1084,7 @@ vpif_query_dv_timings(struct file *file, void *priv, struct v4l2_input input; int ret; - if (config->chan_config[ch->channel_id].inputs == NULL) + if (!config->chan_config[ch->channel_id].inputs) return -ENODATA; chan_cfg = &config->chan_config[ch->channel_id]; @@ -1120,7 +1120,7 @@ static int vpif_s_dv_timings(struct file *file, void *priv, struct v4l2_input input; int ret; - if (config->chan_config[ch->channel_id].inputs == NULL) + if (!config->chan_config[ch->channel_id].inputs) return -ENODATA; chan_cfg = &config->chan_config[ch->channel_id]; @@ -1218,7 +1218,7 @@ static int vpif_g_dv_timings(struct file *file, void *priv, struct vpif_capture_chan_config *chan_cfg; struct v4l2_input input; - if (config->chan_config[ch->channel_id].inputs == NULL) + if (!config->chan_config[ch->channel_id].inputs) return -ENODATA; chan_cfg = &config->chan_config[ch->channel_id]; @@ -1465,7 +1465,7 @@ static __init int vpif_probe(struct platform_device *pdev) subdev_count = vpif_obj.config->subdev_count; vpif_obj.sd = kcalloc(subdev_count, sizeof(*vpif_obj.sd), GFP_KERNEL); - if (vpif_obj.sd == NULL) { + if (!vpif_obj.sd) { err = -ENOMEM; goto vpif_unregister; }