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: 9712317 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 A426D6020B for ; Thu, 4 May 2017 16:57:08 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 964FF281E1 for ; Thu, 4 May 2017 16:57:08 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 89996284D1; Thu, 4 May 2017 16:57:08 +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 2DE37281E1 for ; Thu, 4 May 2017 16:57:08 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 1A30B6E58C; Thu, 4 May 2017 16:57:07 +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.17.11]) by gabe.freedesktop.org (Postfix) with ESMTPS id F16956E58C for ; Thu, 4 May 2017 16:57:04 +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 Subject: [PATCH 5/9] drm/i915: Adjust seven checks for null pointers 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:9UIY4gRIeQ8=:bWG4UO5FeNC8R7R78Yh6C5 NkOZwND+6+mDWuKOX1epo1TT01Zl3Qx9zMLwuZcUpqiFopCq1o0htt3G1b6xpDhRjj7vfKKTU gX5XRzIHglIGn0EgNDk7Hfw/qFMCp/EuF2jE2FdrTlVMw+4ccb/GeS4VDHZkAZTs5r2LTalte NTPXCrBGIkUKbwhcati2VTGRHxjBr6clWcJVCT7lbniuXZOnEEsBFrhyEFKu1Y7JtJxCVgQNS E46giplQ8Bgelrk7VgieA+pAlHLu2LxEg4AHBipS6geUzlNB1I95jY8vVxoAh3JOGhuoC+1iA OZwdv1V+z9BaOBStqyLWgEVwtZv2KQashhjcF2q01aaXjosjmgmk9B1ebhocAJQcE7+b3zEhm twYbh2LqnV85Ic6yPyfo+2SyTTZVRj5rnJt+Qtugay8jHh5ezhUPLVa2P2Cz960X91iED7Q2p +JuRZmmnLJl3pGb4gLXaQvqmd8/LFN8VKteSf+pUPJtz+FWXibKk8LqxxQBsnLTr5s9UfMjEl uiJc+wOBaCObf9pjl+8aWOaGOYmfsm0uwnPQ10GO2kmBW+ResIH2f+kWsNkDr6Uni3e0fZDXt 7AUW3lVzQm68zXnGue3R7H7LSnY+GrCjjHIKI/ssrbd9g38tZXoQKC074LZNKEiT2lQSw1mfm CMa8PndAJAQTC0s2PMSrmwFuxCCleiypXDMFR0ZzO+HlV4GRTp3KYwf6yeTel3FzBsvewDTym dkvzvDY/R3ycN6bqWHc1wqLGFAMHktDlXpOpZc1Cdp1QAWmlcF7lINYO//G6K/0L7AKV9NwtL yPOMNm7baXgPMOm7tXseRp+2NrV/g== Cc: kernel-janitors@vger.kernel.org, LKML 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: 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 {