From patchwork Wed Nov 1 15:41:05 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: SF Markus Elfring X-Patchwork-Id: 10036649 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 94EAD6032D for ; Wed, 1 Nov 2017 15:41:29 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3413626E54 for ; Wed, 1 Nov 2017 15:41:29 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 290D328C7B; Wed, 1 Nov 2017 15:41:29 +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=-4.2 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 2702C28C73 for ; Wed, 1 Nov 2017 15:41:28 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 7C10C6E798; Wed, 1 Nov 2017 15:41:27 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mout.web.de (mout.web.de [212.227.15.3]) by gabe.freedesktop.org (Postfix) with ESMTPS id 4BE706E798 for ; Wed, 1 Nov 2017 15:41:25 +0000 (UTC) Received: from [192.168.1.3] ([77.182.103.203]) by smtp.web.de (mrweb002 [213.165.67.108]) with ESMTPSA (Nemesis) id 0MUVrX-1djgvO46Ud-00RL5N; Wed, 01 Nov 2017 16:41:10 +0100 Subject: [PATCH v2 2/2] drm/rcar-du: Adjust 14 checks for null pointers From: SF Markus Elfring To: kbuild test robot , dri-devel@lists.freedesktop.org, linux-renesas-soc@vger.kernel.org, Dan Carpenter , David Airlie , Jani Nikula , Laurent Pinchart References: <201710262044.165nsaJp%fengguang.wu@intel.com> <26b811dd-9dfa-cfd3-7d4d-e7f1c852b8ed@users.sourceforge.net> Message-ID: Date: Wed, 1 Nov 2017 16:41:05 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.4.0 MIME-Version: 1.0 In-Reply-To: <26b811dd-9dfa-cfd3-7d4d-e7f1c852b8ed@users.sourceforge.net> Content-Language: en-GB X-Provags-ID: V03:K0:8Y9T+eNqwsRpQqO1mzfIFYCyCFtyZ/SRdduBB1wSfNakrFPdg9q 6QInhL7/0JRv+ap1btldlM07aZ+LIc/yUUbE/1bUZA6MkHWkpuVqnn2RxcOVBdTkBlt4avo XxnRgql0jQcs4RKGdIGXPMhUsdD6ayhtQHla7KNLapDzeCep+TCyV7X9S7naTRIUIHBjpZ/ 22yIY8lYEIE/2lHo84f8A== X-UI-Out-Filterresults: notjunk:1; V01:K0:zFf+JYZZ3yY=:pJ5oQB/EaZ9Rt3zcI7Nwiv Qgifa8F58pgU3cLJKcJ/W6Kc6SyD72zHgL0wuxs7XNMLpShmkNSATNYnYRxdr1rIXMNK08jYL 2Nbys0VDP4ovAdKPR7ELj7ucb4L1JAf+GX8tCWsffA7WXc+aInTDMsidBMLzNGFnMyXBPMvAs IAb2kJKBCOJyQ+DtfdxhjHtrjJT5Rvu40WI/OdO3HNqcce4Oq1eNWdfRg5TX8pQT1Yd+Qyjwv FxAkl11PUEdea6pss8JfOinenk5l+2mSd91mAyE121CUbGuzyriVZoflBh5kNPuMtON6Lo96Y l25ZL9M/PXlYfytD8c+WBPaa4BNzWps4e3JYDD6AxU8FycYlwVlEyX5dhOMteK75tfEFRINAR 3hRtGlTg/O0MBt47dAPbcCPXCY3TarB5x/eNya0hwmeANwczFbcQSR7jbK90ji8fIAweGIqE5 PvN2aE9BskLurW7WDkO4LKVXmvmYcrlw3kLyrla2jIoO2yezXD68RfXpbCnXUG0VxvarcE4DC BxvWXPejy/IUEXl0DnK1Ln1uo7H/Doe1hVvSOK5qYnVqbSXI1uluZpANP85xYEi3xXTFes6hI Kvgd4Tzoh3bQwy+pbc5H9RvWuR/fQbQUDzwVlmCzVB+CG8Mzy+OYDxIRQbS5K4rYjnu/gAthJ hP8x/wN7E9xX8Ox3v8VFaUn+/mFsEA0E48Wy/E97tj2r7IViMkJewJPN9EtQ0BOz5YL26rOeA GiJfhcdFcnwU5xFC4Mb0K8bbCy6L80NRP2cS4Cs5Z72i65Xo555DWhCMGWQRicU13tUmRrsDE nJMjHZQpsGMV2Ij87w66vOoyuYBE6lyXVtbEcn4eQDS0TWHtX0= Cc: Geert Uytterhoeven , kernel-janitors@vger.kernel.org, LKML , kbuild-all@01.org X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP From: Markus Elfring Date: Wed, 1 Nov 2017 16:00:46 +0100 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 --- v2: The commit message was written only with ASCII characters. drivers/gpu/drm/rcar-du/rcar_du_crtc.c | 2 +- drivers/gpu/drm/rcar-du/rcar_du_drv.c | 2 +- drivers/gpu/drm/rcar-du/rcar_du_encoder.c | 2 +- drivers/gpu/drm/rcar-du/rcar_du_kms.c | 6 +++--- drivers/gpu/drm/rcar-du/rcar_du_lvdscon.c | 2 +- drivers/gpu/drm/rcar-du/rcar_du_lvdsenc.c | 2 +- drivers/gpu/drm/rcar-du/rcar_du_plane.c | 6 +++--- drivers/gpu/drm/rcar-du/rcar_du_vsp.c | 6 +++--- 8 files changed, 14 insertions(+), 14 deletions(-) diff --git a/drivers/gpu/drm/rcar-du/rcar_du_crtc.c b/drivers/gpu/drm/rcar-du/rcar_du_crtc.c index 301ea1a8018e..67567af6e348 100644 --- a/drivers/gpu/drm/rcar-du/rcar_du_crtc.c +++ b/drivers/gpu/drm/rcar-du/rcar_du_crtc.c @@ -410,7 +410,7 @@ void rcar_du_crtc_finish_page_flip(struct rcar_du_crtc *rcrtc) rcrtc->event = NULL; spin_unlock_irqrestore(&dev->event_lock, flags); - if (event == NULL) + if (!event) return; spin_lock_irqsave(&dev->event_lock, flags); diff --git a/drivers/gpu/drm/rcar-du/rcar_du_drv.c b/drivers/gpu/drm/rcar-du/rcar_du_drv.c index d2f29e6b1112..cf80476783bf 100644 --- a/drivers/gpu/drm/rcar-du/rcar_du_drv.c +++ b/drivers/gpu/drm/rcar-du/rcar_du_drv.c @@ -318,7 +318,7 @@ static int rcar_du_probe(struct platform_device *pdev) /* Allocate and initialize the R-Car device structure. */ rcdu = devm_kzalloc(&pdev->dev, sizeof(*rcdu), GFP_KERNEL); - if (rcdu == NULL) + if (!rcdu) return -ENOMEM; rcdu->dev = &pdev->dev; diff --git a/drivers/gpu/drm/rcar-du/rcar_du_encoder.c b/drivers/gpu/drm/rcar-du/rcar_du_encoder.c index ba8d2804c1d1..8a9f7fa69ecc 100644 --- a/drivers/gpu/drm/rcar-du/rcar_du_encoder.c +++ b/drivers/gpu/drm/rcar-du/rcar_du_encoder.c @@ -166,7 +166,7 @@ int rcar_du_encoder_init(struct rcar_du_device *rcdu, int ret; renc = devm_kzalloc(rcdu->dev, sizeof(*renc), GFP_KERNEL); - if (renc == NULL) + if (!renc) return -ENOMEM; renc->output = output; diff --git a/drivers/gpu/drm/rcar-du/rcar_du_kms.c b/drivers/gpu/drm/rcar-du/rcar_du_kms.c index b6b341164aab..c15aa38fe308 100644 --- a/drivers/gpu/drm/rcar-du/rcar_du_kms.c +++ b/drivers/gpu/drm/rcar-du/rcar_du_kms.c @@ -181,7 +181,7 @@ rcar_du_fb_create(struct drm_device *dev, struct drm_file *file_priv, unsigned int i; format = rcar_du_format_info(mode_cmd->pixel_format); - if (format == NULL) { + if (!format) { dev_dbg(dev->dev, "unsupported pixel format %08x\n", mode_cmd->pixel_format); return ERR_PTR(-EINVAL); @@ -419,7 +419,7 @@ static int rcar_du_properties_init(struct rcar_du_device *rcdu) { rcdu->props.alpha = drm_property_create_range(rcdu->ddev, 0, "alpha", 0, 255); - if (rcdu->props.alpha == NULL) + if (!rcdu->props.alpha) return -ENOMEM; /* @@ -430,7 +430,7 @@ static int rcar_du_properties_init(struct rcar_du_device *rcdu) rcdu->props.colorkey = drm_property_create_range(rcdu->ddev, 0, "colorkey", 0, 0x01ffffff); - if (rcdu->props.colorkey == NULL) + if (!rcdu->props.colorkey) return -ENOMEM; return 0; diff --git a/drivers/gpu/drm/rcar-du/rcar_du_lvdscon.c b/drivers/gpu/drm/rcar-du/rcar_du_lvdscon.c index b373ad48ef5f..189e71b3d5d4 100644 --- a/drivers/gpu/drm/rcar-du/rcar_du_lvdscon.c +++ b/drivers/gpu/drm/rcar-du/rcar_du_lvdscon.c @@ -63,7 +63,7 @@ int rcar_du_lvds_connector_init(struct rcar_du_device *rcdu, int ret; rcon = devm_kzalloc(rcdu->dev, sizeof(*rcon), GFP_KERNEL); - if (rcon == NULL) + if (!rcon) return -ENOMEM; connector = &rcon->connector; diff --git a/drivers/gpu/drm/rcar-du/rcar_du_lvdsenc.c b/drivers/gpu/drm/rcar-du/rcar_du_lvdsenc.c index 12d22f3db1af..ab2576e5d700 100644 --- a/drivers/gpu/drm/rcar-du/rcar_du_lvdsenc.c +++ b/drivers/gpu/drm/rcar-du/rcar_du_lvdsenc.c @@ -253,7 +253,7 @@ int rcar_du_lvdsenc_init(struct rcar_du_device *rcdu) for (i = 0; i < rcdu->info->num_lvds; ++i) { lvds = devm_kzalloc(&pdev->dev, sizeof(*lvds), GFP_KERNEL); - if (lvds == NULL) + if (!lvds) return -ENOMEM; lvds->dev = rcdu; diff --git a/drivers/gpu/drm/rcar-du/rcar_du_plane.c b/drivers/gpu/drm/rcar-du/rcar_du_plane.c index 61833cc1c699..f48a990214ed 100644 --- a/drivers/gpu/drm/rcar-du/rcar_du_plane.c +++ b/drivers/gpu/drm/rcar-du/rcar_du_plane.c @@ -584,7 +584,7 @@ static int rcar_du_plane_atomic_check(struct drm_plane *plane, } rstate->format = rcar_du_format_info(state->fb->format->format); - if (rstate->format == NULL) { + if (!rstate->format) { dev_dbg(rcdu->dev, "%s: unsupported format %08x\n", __func__, state->fb->format->format); return -EINVAL; @@ -637,7 +637,7 @@ rcar_du_plane_atomic_duplicate_state(struct drm_plane *plane) state = to_rcar_plane_state(plane->state); copy = kmemdup(state, sizeof(*state), GFP_KERNEL); - if (copy == NULL) + if (!copy) return NULL; __drm_atomic_helper_plane_duplicate_state(plane, ©->state); @@ -662,7 +662,7 @@ static void rcar_du_plane_reset(struct drm_plane *plane) } state = kzalloc(sizeof(*state), GFP_KERNEL); - if (state == NULL) + if (!state) return; state->hwindex = -1; diff --git a/drivers/gpu/drm/rcar-du/rcar_du_vsp.c b/drivers/gpu/drm/rcar-du/rcar_du_vsp.c index 2c96147bc444..e8e261362d9a 100644 --- a/drivers/gpu/drm/rcar-du/rcar_du_vsp.c +++ b/drivers/gpu/drm/rcar-du/rcar_du_vsp.c @@ -283,7 +283,7 @@ static int rcar_du_vsp_plane_atomic_check(struct drm_plane *plane, } rstate->format = rcar_du_format_info(state->fb->format->format); - if (rstate->format == NULL) { + if (!rstate->format) { dev_dbg(rcdu->dev, "%s: unsupported format %08x\n", __func__, state->fb->format->format); return -EINVAL; @@ -323,7 +323,7 @@ rcar_du_vsp_plane_atomic_duplicate_state(struct drm_plane *plane) state = to_rcar_vsp_plane_state(plane->state); copy = kmemdup(state, sizeof(*state), GFP_KERNEL); - if (copy == NULL) + if (!copy) return NULL; __drm_atomic_helper_plane_duplicate_state(plane, ©->state); @@ -348,7 +348,7 @@ static void rcar_du_vsp_plane_reset(struct drm_plane *plane) } state = kzalloc(sizeof(*state), GFP_KERNEL); - if (state == NULL) + if (!state) return; state->alpha = 255;