From patchwork Fri May 5 13:57:25 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: 9713611 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 E816060362 for ; Fri, 5 May 2017 13:57:34 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id DB30E280B0 for ; Fri, 5 May 2017 13:57:34 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id CEBDE28652; Fri, 5 May 2017 13:57:34 +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 64B5E280B0 for ; Fri, 5 May 2017 13:57:34 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id E4AE26E692; Fri, 5 May 2017 13:57:33 +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 6955D6E692 for ; Fri, 5 May 2017 13:57:31 +0000 (UTC) Received: from [192.168.1.3] ([78.48.246.181]) by smtp.web.de (mrweb004 [213.165.67.108]) with ESMTPSA (Nemesis) id 0MNx4F-1d9h4m1dMp-007RVC; Fri, 05 May 2017 15:57:27 +0200 Subject: [PATCH 5/5] drm/sti: Adjust two checks for null pointers in sti_hqvdp_probe() From: SF Markus Elfring To: dri-devel@lists.freedesktop.org, Benjamin Gaignard , David Airlie , Fabien Dessenne , Vincent Abriou References: Message-ID: <918229e6-80fe-629f-8fec-bf60ac15275f@users.sourceforge.net> Date: Fri, 5 May 2017 15:57:25 +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: Content-Language: en-US X-Provags-ID: V03:K0:ek5AiG9n12MOYO5vqXIKb1yFqy3HjtYbUzsoiTC1GLd2EzWAHOx rWnkDqiM5gI7W+tSAITCvEB9TxysCL5Lo6lgfUjkM4LMrkmGtgs1uSWcJBZXO7mxxzV1ElQ P6vgxuUqAq5mM5C3rNIYGYuZBQLdTxzCMQHySZy19uSVwGZFwffizsSePG/3Qrhy0CL4FDw 2XpBvIJ9RzciBmghADUZQ== X-UI-Out-Filterresults: notjunk:1; V01:K0:yV9navpzm2A=:pRUFRKOaHVnrkdH0tgBj45 MUOXN5zfT+6qzFr5CQ8r70jrmWZZ1OnESFcRDkrExu6+26PkPSl4qDkcJan8NQ77ZtVqaEhlY Vfq9cOo0YPdl4pCiMR7TOMA2n2FyxxLQJN69g0s2el/bSRANOhe3Lv5983qBX6/OIFUaOsF03 wk8uxVSm0sDrTdd/VciH+ANtz0Pya57FvH/oVPIkYuikl5+mN5I++/V6aQ/LP50IRmzveS+7y ECm2c3Ws2YQ0BBhUL8SVJRUtkrfhcRKDkL2zZVvaY33PcrVTCSI8LA7sDS2H79ZrUe3JbmtGi 2QDZVK5NP+JYCD04W/nnlIW1H4vetDDyTFc1tvvRWROt17Z1+I5z4ChRLNbYE3sPe8QF51ANd EC3nswD3WBLJI9OsS9SINKJEIEuDpQGVZcnqsAFPE8EjWi4K7NraIbQ3O+CWxGev9NDwYXJK3 akhAWGglWP0yW9pbIBolbtx7IqqhFiaIjUuQbSkHf5zWap8oyOPJcHwx+vJ6iygSqc2nvuCMZ djoCegedKweNtX6WlQ/c9TrkzhSa2w8KATTVTAGMX5Otpe92mVGhQS/i/iZDwVWLn672+PAnX EcU4fVoPXnabegvWhgGiZ940aafrHkmvkxiPMwxigEFvfPUiayAurX8j7S+5HH3QiDMtin/Z+ B0cmagJ1ED4S0cwI2nuhX7D73KmACwezhPgmaDGuCWkzEBzLsQBWyRfEA4JyQCnS2cWD7yr2S yzEiNDDDM31G4EdV13wDWPSRnGJ5QpJuJkh7D8/gtwaVQ478C/bUt4Sxvrzoly1O5RMrccnFS 9gVN4c5 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: Fri, 5 May 2017 15:33: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 the affected source code places. Signed-off-by: Markus Elfring --- drivers/gpu/drm/sti/sti_hqvdp.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/sti/sti_hqvdp.c b/drivers/gpu/drm/sti/sti_hqvdp.c index 372ea294da80..a1c161f77804 100644 --- a/drivers/gpu/drm/sti/sti_hqvdp.c +++ b/drivers/gpu/drm/sti/sti_hqvdp.c @@ -1356,12 +1356,12 @@ static int sti_hqvdp_probe(struct platform_device *pdev) /* Get Memory resources */ res = platform_get_resource(pdev, IORESOURCE_MEM, 0); - if (res == NULL) { + if (!res) { DRM_ERROR("Get memory resource failed\n"); return -ENXIO; } hqvdp->regs = devm_ioremap(dev, res->start, resource_size(res)); - if (hqvdp->regs == NULL) { + if (!hqvdp->regs) { DRM_ERROR("Register mapping failed\n"); return -ENXIO; }