From patchwork Thu May 4 16:56:56 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: 9712353 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 A33DC6020B for ; Thu, 4 May 2017 17:02:22 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 94F8328614 for ; Thu, 4 May 2017 17:02:22 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 892EF286A3; Thu, 4 May 2017 17:02:22 +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=unavailable 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 8B9CA28614 for ; Thu, 4 May 2017 17:02:21 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id C41206E579; Thu, 4 May 2017 17:02:20 +0000 (UTC) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mout.web.de (mout.web.de [217.72.192.78]) by gabe.freedesktop.org (Postfix) with ESMTPS id 6809E6E579 for ; Thu, 4 May 2017 17:02:19 +0000 (UTC) Received: from [192.168.1.2] ([92.228.166.245]) by smtp.web.de (mrweb102 [213.165.67.124]) with ESMTPSA (Nemesis) id 0MddFQ-1dR7cz0NfI-00PQme; Thu, 04 May 2017 18:56:57 +0200 From: SF Markus Elfring To: dri-devel@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, Chris Wilson , Daniel Vetter , David Airlie , Jani Nikula References: <39c8a155-cf89-1aa5-9ca6-4e9ccf3aa602@users.sourceforge.net> Message-ID: <0fb8a6a5-f9ee-1e5d-d52d-5faca3ecde0d@users.sourceforge.net> Date: Thu, 4 May 2017 18:56:56 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.0.1 MIME-Version: 1.0 In-Reply-To: <39c8a155-cf89-1aa5-9ca6-4e9ccf3aa602@users.sourceforge.net> Content-Language: en-US X-Provags-ID: V03:K0:doKPqgajt5Db5eHbK7qqpv4xXhWnX0Q/0SVsdiRSKiLm2kwOJyP ITN2j2gR/JXE2yL7E3L3323e0qYvJYwVHYjPOgj2xXwOrEdrdFZXgpWyvKhOPvanumQHwko BzwFa6xEhKbikQchlqJRKNmyZFgVnBpmpMy+TmRi6dYINZQ6pLOCZExHcFdTsLHXRj/3jiT fKB26uEkTgUg4lCYuwoVA== X-UI-Out-Filterresults: notjunk:1; V01:K0:Uoge6bw9Hpo=:Sep78gnbQFFjoMd9297+ZY 99WFo/+v4x302vXnAI1V72ceXtvh/3kqy7E4+Px68GJdxqepYsFt3UFqQjGuVCBByydPtPEEq D+WvHIcGXU+P+EWlgwh2XEzV/2T9KVzcja43rOk5iCeQBq/jyaDUhucm4TzdEYMscs05ufKbX mSNBCPVi5QcwGX0BFFsyHzBFnI1+eURF0pKH1x0KTyGsH+fj6M1neeE5xEKCLb7Y1OpvESw0/ QzndQTKyDI6jMacz+assbvfN1JqAGlBGHokQd2Ms4ajihxyHhfP+iBohkR3CgNSAVHxlCHHy9 U1xvO4PmauQY7qUR5AORYEJGUxBSaCKBoMmdBJp2tOOs5u+nOIwmFnXA9hADmztF9mQMTmPm6 vFhJVao9QGn8IQaBF1jnV7aGyyWW6b2f1uJmmDgYJEcSGPgFPDeBaIBE+HfOcp7V4RnvSSxdR Yz4qkTKrU0Ky8oPvsK+coJ3u2evKsaZ3fTtUDD1LBc/+8y5KE+39i1ql6bgPC5LrqbsJSIJja BGJ1e7YmNuEIU796NGjYTyd5qKYwaL8NjVmOv3VpjaRlyRhHDfHHTpxBP3qQTb2pTpfq7VxLH Jna8Yv2296SwqZMrxi2UoF86jZTEKMhKMIhZ1xZ/9OMPwdsTduzcYMJSBKybyXjX8QT4UMLoB Xa6q+juZtcnrPSR6z111uxgLe3Quqxi6rWD1HJsCwG48ZTlt2Bb8NqU+AmrcAhsgirxPJya4+ dzBzWo94emv67EKB1P9b+AoWygII25BusaKQRUvnSq52wCl6y48n2mPvC8BcxtMfx3nMzRr0H 6tiAD6+7xZ1KrHPo3GS1403pzVtlg== Cc: kernel-janitors@vger.kernel.org, LKML Subject: [Intel-gfx] [PATCH 5/9] drm/i915: Adjust seven checks for null pointers X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" X-Virus-Scanned: ClamAV using ClamSMTP From: Markus Elfring Date: Thu, 4 May 2017 13:52:19 +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 affected source code places. Signed-off-by: Markus Elfring --- drivers/gpu/drm/i915/i915_debugfs.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/drivers/gpu/drm/i915/i915_debugfs.c b/drivers/gpu/drm/i915/i915_debugfs.c index bf9a2e8d8c16..d9c699d7245e 100644 --- a/drivers/gpu/drm/i915/i915_debugfs.c +++ b/drivers/gpu/drm/i915/i915_debugfs.c @@ -242,7 +242,7 @@ static int i915_gem_stolen_list_info(struct seq_file *m, void *data) if (count == total) break; - if (obj->stolen == NULL) + if (!obj->stolen) continue; objects[count++] = obj; @@ -254,7 +254,7 @@ static int i915_gem_stolen_list_info(struct seq_file *m, void *data) if (count == total) break; - if (obj->stolen == NULL) + if (!obj->stolen) continue; objects[count++] = obj; @@ -557,7 +557,7 @@ static int i915_gem_pageflip_info(struct seq_file *m, void *data) spin_lock_irq(&dev->event_lock); work = crtc->flip_work; - if (work == NULL) { + if (!work) { seq_printf(m, "No flip due on pipe %c (plane %c)\n", pipe, plane); } else { @@ -3717,7 +3717,7 @@ static ssize_t i915_displayport_test_active_write(struct file *file, continue; if (connector->status == connector_status_connected && - connector->encoder != NULL) { + connector->encoder) { intel_dp = enc_to_intel_dp(connector->encoder); status = kstrtoint(input_buffer, 10, &val); if (status < 0) @@ -3756,7 +3756,7 @@ static int i915_displayport_test_active_show(struct seq_file *m, void *data) continue; if (connector->status == connector_status_connected && - connector->encoder != NULL) { + connector->encoder) { intel_dp = enc_to_intel_dp(connector->encoder); seq_putc(m, intel_dp->compliance.test_active ? '1' : '0'); @@ -3801,7 +3801,7 @@ static int i915_displayport_test_data_show(struct seq_file *m, void *data) continue; if (connector->status == connector_status_connected && - connector->encoder != NULL) { + connector->encoder) { intel_dp = enc_to_intel_dp(connector->encoder); if (intel_dp->compliance.test_type == DP_TEST_LINK_EDID_READ) @@ -3855,7 +3855,7 @@ static int i915_displayport_test_type_show(struct seq_file *m, void *data) continue; if (connector->status == connector_status_connected && - connector->encoder != NULL) { + connector->encoder) { intel_dp = enc_to_intel_dp(connector->encoder); seq_printf(m, "%02lx", intel_dp->compliance.test_type); } else {