From patchwork Mon Sep 4 20:12:38 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: SF Markus Elfring X-Patchwork-Id: 9937589 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 E16676035F for ; Mon, 4 Sep 2017 20:14:03 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D2588287B4 for ; Mon, 4 Sep 2017 20:14:03 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C5380287EF; Mon, 4 Sep 2017 20:14:03 +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 78EAB287B4 for ; Mon, 4 Sep 2017 20:14:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754619AbdIDUM4 (ORCPT ); Mon, 4 Sep 2017 16:12:56 -0400 Received: from mout.web.de ([212.227.17.11]:56638 "EHLO mout.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754442AbdIDUMr (ORCPT ); Mon, 4 Sep 2017 16:12:47 -0400 Received: from [192.168.1.2] ([78.48.84.177]) by smtp.web.de (mrweb103 [213.165.67.124]) with ESMTPSA (Nemesis) id 0MCqkB-1dgOsW40Lj-009h6u; Mon, 04 Sep 2017 22:12:40 +0200 Subject: [PATCH 6/6] [media] atmel-isi: Adjust a null pointer check in three functions From: SF Markus Elfring To: linux-media@vger.kernel.org, Ludovic Desroches , Mauro Carvalho Chehab , Songjun Wu Cc: LKML , kernel-janitors@vger.kernel.org References: <88d0739c-fdc1-9d7d-fe53-b7c2eeed1849@users.sourceforge.net> Message-ID: Date: Mon, 4 Sep 2017 22:12:38 +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: <88d0739c-fdc1-9d7d-fe53-b7c2eeed1849@users.sourceforge.net> Content-Language: en-GB X-Provags-ID: V03:K0:nfF08BrL0Fqlj6DjEmIfEEls7Uo8rvIWcZvJz49/4qNyq+uwRLs 8FrbJ71KCn8vpsBrTQ/7A9vuT8T7tB96ZU+JfyRuZjLkT8LmsCHUq5ps1ewTQX/BXm4KVwA je8bQJkvtcrDJKHFBXRrL/SnIngk3hsCsgoIi6sII++wKsEHUFqDset29dml5sCytnlFu/Z uI5qhS3y2+FBBKrbVY8VQ== X-UI-Out-Filterresults: notjunk:1; V01:K0:W9tFLD1LLnA=:iv2YEcKma4mS6mw21kgWSK 3spXW7WN3KOJ9B8mnTbgFOq0kzgRDKvcWK91PxBsU1WyAOq2lIP9UhJochT0lZZWPsFM1190+ 4T2pMcYAl74oL7UTh4zc8n+X8Jn4ZpbovqDSoMIb7DPt5TCTgZCPnfRosxtGSqEiasOSX7jwL sk3MhB1MKQUeqwuN86sJ46o0tJNi8EdFNKycQiBKXSKlI64hOMBp7jJlvNABrVkO3hB+AR3i9 JXZfM1h7VrfCNw0B22iB3FujKt+mjxeybZN+aQEqTvqZnXei1TJdefxfa+75E6uFISi5BBRzD /fvTtsaUh4TLML/IQ1HRF5a3sp+YBKGwZVlen6N5/RHmNf4/rlGoUPb/4vMSVp6TTOCgPgRDl v7sbX9zqTAjPUts0uQvZRdFd1AOkeb6JdZhGRnbMJhvgXmfsNlI9sbR0hbQnf+rxmfrgxemGR IKPiLb3MCXu9e52MTyA46VlD88xAFZBlMBbqdCc6ejDHPhDBSE0qBUUx4x1e+Elwa4ck+TCrD RJ/qVphLybVjR0Fml2TyIp50G45eQVe3dI9TJPejhcqdGUvmgpSbccOyW5YesAj/xoN3cOkMN KSxAo5wNdO1AyuhzJQzVdUIUq/tD9iebZ4HBw4GVcSeWBYCpzkc2m7jCtx7CGY/OpmKp8qAsP xiYt6zkJfPwP9UJ71+OhwwpdRjkoJUHTna/mrFmDlDjd2swPk6+OkHzOMU56z81x5zDdS4gIT AiZAo7ZQFjm2ZMjq/49JV8nHI7GW91iKRVREancOfaPxPDMCzdkEiNFQZ4iCTAQkpkYUD29Jl 4Xl2wK/IX5FaVOcxzDgSFC9Fc4lvImlbBYzLYLbzj2jZK0xx+k= 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: Mon, 4 Sep 2017 21:30:48 +0200 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- drivers/media/platform/atmel/atmel-isi.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/media/platform/atmel/atmel-isi.c b/drivers/media/platform/atmel/atmel-isi.c index ac40defce1e7..f2e13dfb19a1 100644 --- a/drivers/media/platform/atmel/atmel-isi.c +++ b/drivers/media/platform/atmel/atmel-isi.c @@ -411,7 +411,7 @@ static void buffer_queue(struct vb2_buffer *vb) spin_lock_irqsave(&isi->irqlock, flags); list_add_tail(&buf->list, &isi->video_buffer_list); - if (isi->active == NULL) { + if (!isi->active) { isi->active = buf; if (vb2_is_streaming(vb->vb2_queue)) start_dma(isi, buf); @@ -1141,7 +1141,7 @@ static int isi_graph_init(struct atmel_isi *isi) /* Register the subdevices notifier. */ subdevs = devm_kzalloc(isi->dev, sizeof(*subdevs), GFP_KERNEL); - if (subdevs == NULL) { + if (!subdevs) { of_node_put(isi->entity.node); return -ENOMEM; } @@ -1200,7 +1200,7 @@ static int atmel_isi_probe(struct platform_device *pdev) return ret; isi->vdev = video_device_alloc(); - if (isi->vdev == NULL) { + if (!isi->vdev) { ret = -ENOMEM; goto err_vdev_alloc; }