From patchwork Sat Sep 2 13:07:51 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: 9935539 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 0F621601A1 for ; Sat, 2 Sep 2017 13:08:14 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0113D28619 for ; Sat, 2 Sep 2017 13:08:14 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E8D6D2861D; Sat, 2 Sep 2017 13:08:13 +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 A0B3928619 for ; Sat, 2 Sep 2017 13:08:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752712AbdIBNIB (ORCPT ); Sat, 2 Sep 2017 09:08:01 -0400 Received: from mout.web.de ([212.227.17.11]:49551 "EHLO mout.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752399AbdIBNIA (ORCPT ); Sat, 2 Sep 2017 09:08:00 -0400 Received: from [192.168.1.2] ([78.48.84.48]) by smtp.web.de (mrweb103 [213.165.67.124]) with ESMTPSA (Nemesis) id 0MOipW-1dt5yA1uoY-006AtI; Sat, 02 Sep 2017 15:07:52 +0200 Subject: [PATCH 2/4] [media] adv7604: Adjust a null pointer check in three functions From: SF Markus Elfring To: linux-media@vger.kernel.org, Hans Verkuil , Mauro Carvalho Chehab Cc: LKML , kernel-janitors@vger.kernel.org References: <0e67e095-4931-b78f-a925-7335326ab69c@users.sourceforge.net> Message-ID: Date: Sat, 2 Sep 2017 15:07: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: <0e67e095-4931-b78f-a925-7335326ab69c@users.sourceforge.net> Content-Language: en-GB X-Provags-ID: V03:K0:XLCM3aBeX3BU7l6B/8gABX1DZP0IQyG8D/uzAIR1OwjevXpU5vv 2XCYr0GZ6upkaouu/CneShvOxqvh87dSqugw+XMUSIyeruN+DClu9jvIOZW7qlsRRK7DdR+ pGLwNz7qjcJEYh97fGs7AgVhd9+sTaXR6UgC67J5SVgi7vZRWc2MsWXn3K0poOXo0zd5npx YEkgK0yr32wPA1KKT39jw== X-UI-Out-Filterresults: notjunk:1; V01:K0:QV1pCLT40TU=:ubhueFsdV9qOVF2y3uGEAW QWYymnwLaUbX2ODDgnYVd6l/SL/yAZpsSvDv3P0RPtPExcK1/7mlcg3u6ici2xTUrJpgJyQPl dKx1y1pAy4dN1wnJflgjF8kpKiNvcy1HlbMHb4HtVLDc+l8CcyxBbF3LmkGA+7ZLBBRSX2jBj seoy4+UAgtbltKm270jvOK7SjL7LH104D4dWm2UKlahMCywVWa3swgJt9W5C0htN95QmuX87r CYZl/HnhetRUlnQjKTYISHtqysqx9BvxAU5jYRbPsg4CG5ZBoDiP2sCxTB6Hl76iqN6Ekswf3 RawpsFfmIkmnVsXDiqT6DdWi3t3jcZLYzR8PureEakhFBKuO9fGYknZ4j8luLfnLNTE/87Qxl PAnJ6btc9FP3vbmGqHPFIf83Yto7ylTE4DDh0C9DxLsEC0nTIzR3KikNor6Q8cxfS18YqBYqn +B7hDhpA8oyQU0I69t44pN+xVp0ewTmp96MJ9DR8j4CSsQv3xuYLyIIDJ/X7pYOox0F+tbxz3 n33zH3WtHEljI7SHzieVCKbnBbCuYoUN6Zb8jn6cKEvBARVn2ZWDQNF1tIKol2G7maiWf1CGe z/yRO+EN9N+si7OQS0pXSMnt/7pDpdUf2UdfXBHgIoCRF7BWUzB2H9ANaiNW6kzPXV6QZI1b+ 2pMSPNR8iC/NXp1M55Pna/pVqX1Z3VU1a1FeIaE6ozbsWeh4gI1CkTJI9W4Pv2kg15AoQ251W 0MaVmix7uVSnc1kLC8s1Y+TPtsuweTRFGKiIrqoJHPZuuD32pK65f7aZJuqhZs2towDu5LQ9h I+eGe7MtK4YSHqlSzChUkiZ9RkCK4tq340CmdpDXoSBdAMh9qM= 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: Sat, 2 Sep 2017 11:43:00 +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/i2c/adv7604.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/media/i2c/adv7604.c b/drivers/media/i2c/adv7604.c index cc693ef71f33..0a774d025858 100644 --- a/drivers/media/i2c/adv7604.c +++ b/drivers/media/i2c/adv7604.c @@ -1948,7 +1948,7 @@ static int adv76xx_set_format(struct v4l2_subdev *sd, return -EINVAL; info = adv76xx_format_info(state, format->format.code); - if (info == NULL) + if (!info) info = adv76xx_format_info(state, MEDIA_BUS_FMT_YUYV8_2X8); adv76xx_fill_format(state, &format->format); @@ -2256,7 +2256,7 @@ static int adv76xx_get_edid(struct v4l2_subdev *sd, struct v4l2_edid *edid) return 0; } - if (data == NULL) + if (!data) return -ENODATA; if (edid->start_block >= state->edid.blocks) @@ -3480,7 +3480,7 @@ static int adv76xx_probe(struct i2c_client *client, state->i2c_clients[i] = adv76xx_dummy_client(sd, state->pdata.i2c_addresses[i], 0xf2 + i); - if (state->i2c_clients[i] == NULL) { + if (!state->i2c_clients[i]) { err = -ENOMEM; v4l2_err(sd, "failed to create i2c client %u\n", i); goto err_i2c;