From patchwork Fri Nov 6 02:31:19 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?b?546L5pOO?= X-Patchwork-Id: 11885787 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id A97CA697 for ; Fri, 6 Nov 2020 02:37:11 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 91E0C20786 for ; Fri, 6 Nov 2020 02:37:11 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725922AbgKFChK (ORCPT ); Thu, 5 Nov 2020 21:37:10 -0500 Received: from m176115.mail.qiye.163.com ([59.111.176.115]:53284 "EHLO m176115.mail.qiye.163.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725839AbgKFChK (ORCPT ); Thu, 5 Nov 2020 21:37:10 -0500 X-Greylist: delayed 339 seconds by postgrey-1.27 at vger.kernel.org; Thu, 05 Nov 2020 21:37:09 EST Received: from vivo-HP-ProDesk-680-G4-PCI-MT.vivo.xyz (unknown [58.251.74.231]) by m176115.mail.qiye.163.com (Hmail) with ESMTPA id 2AC8D666B20; Fri, 6 Nov 2020 10:31:27 +0800 (CST) From: Wang Qing To: Rob Clark , Sean Paul , David Airlie , Daniel Vetter , Jordan Crouse , Jonathan Marek , Akhil P Oommen , Sharat Masetty , linux-arm-msm@vger.kernel.org, dri-devel@lists.freedesktop.org, freedreno@lists.freedesktop.org, linux-kernel@vger.kernel.org Cc: Wang Qing Subject: [PATCH] drm: Use IS_ERR() instead of null pointer check Date: Fri, 6 Nov 2020 10:31:19 +0800 Message-Id: <1604629881-557-1-git-send-email-wangqing@vivo.com> X-Mailer: git-send-email 2.7.4 X-HM-Spam-Status: e1kfGhgUHx5ZQUtXWQgYFAkeWUFZS1VLWVdZKFlBSE83V1ktWUFJV1kPCR oVCBIfWUFZGk9CHkNOH01NTExPVkpNS09NSUJDQ0xCQkxVEwETFhoSFyQUDg9ZV1kWGg8SFR0UWU FZT0tIVUpKS0hKQ1VLWQY+ X-HM-Sender-Digest: e1kMHhlZQR0aFwgeV1kSHx4VD1lBWUc6MTY6FRw6KT8qQh0BSyweAxgT FkkaCiFVSlVKTUtPTUlCQ0NDT0pMVTMWGhIXVQwaFRwKEhUcOw0SDRRVGBQWRVlXWRILWUFZTkNV SU5KVUxPVUlISllXWQgBWUFJSk1MNwY+ X-HM-Tid: 0a759b64fb769373kuws2ac8d666b20 Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org a6xx_gmu_get_mmio() never return null in case of error, but ERR_PTR(), so we should use IS_ERR() instead of null pointer check Signed-off-by: Wang Qing --- drivers/gpu/drm/msm/adreno/a6xx_gmu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/msm/adreno/a6xx_gmu.c b/drivers/gpu/drm/msm/adreno/a6xx_gmu.c index 491fee4..8c81a89 --- a/drivers/gpu/drm/msm/adreno/a6xx_gmu.c +++ b/drivers/gpu/drm/msm/adreno/a6xx_gmu.c @@ -492,7 +492,7 @@ static void a6xx_gmu_rpmh_init(struct a6xx_gmu *gmu) void __iomem *seqptr = a6xx_gmu_get_mmio(pdev, "gmu_pdc_seq"); uint32_t pdc_address_offset; - if (!pdcptr || !seqptr) + if (IS_ERR(pdcptr) || IS_ERR(seqptr)) goto err; if (adreno_is_a618(adreno_gpu) || adreno_is_a640(adreno_gpu))