Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp1539058ybe; Mon, 2 Sep 2019 23:20:58 -0700 (PDT) X-Google-Smtp-Source: APXvYqygNB+Ti1uko7c/N7ve9TENjVBraNceAeC/V4of/O+6AT1sbgH/POIKEXG81SrkHfCfFeMP X-Received: by 2002:a17:902:a606:: with SMTP id u6mr33262359plq.224.1567491658587; Mon, 02 Sep 2019 23:20:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1567491658; cv=none; d=google.com; s=arc-20160816; b=rch9YururwEgUrx/lr9wCIGck02dBrflvGhqbDtRsKT36Bga/BKgqKcdHGuBTkc9BL +qsxNknnQJ3DPDOFmXa+lMim8sngJidt+bVV+E8Jd8OjdraLMF8OKu0UOgNZeRMGNPfc WNWLI6HpGg3msOAXYTPF7V6kq+IdMjOj6Gl1ddx9osD9yCXDJKVm9UFzDIYBV58Knv+u 683WPtFI393uhNog6kIy8VxexF19ZYmou2aGT3YuOA2YWLNbpymxjqE6x5IsZoDr+sEX cNzhAynepgN+D6F0Mn8fdACgwDLb5rrqJvIe5D39SQ/XjcaTe48qRdLMHGgxXw2pXpMM FgCQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:date:subject:cc :to:from; bh=zZlstjCjasbDizxRAnewGeGHBUCYL8GZ3v4k9fdHVzk=; b=Le4AOZEwDMOg41zksbiZcCOPeaVIegIWPWqg2Eyi2U5Tqg8o0VBaKzPJgdujvzz8eO M41cmWVjQinNGw7QeOWnEcIxjeoCkHP3WdKMs0pUXX9GwUzKZ2wPCLOmrkOuoS9Jax4I LN5Y4XXAgokWsKQAeVP52AT2czU182qtFycHmMI7Jrz1+2ZPpFIZ96BuXSfJvLIqEOH7 EZCEP8W9P75cyyOB7jIwWNOntPpSVfmB5izBnmtq67J9MDceuXnq8yQfAcNe7EKVaWvh C2Pd9nrmmCMhew2akPLwQFgspeLdC6p5gR7qtAVw0fZrSUm4v52Ua9CtiHyKzkPbaFHE gDIA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x125si13628029pgx.332.2019.09.02.23.20.43; Mon, 02 Sep 2019 23:20:58 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727080AbfICGSI (ORCPT + 99 others); Tue, 3 Sep 2019 02:18:08 -0400 Received: from szxga05-in.huawei.com ([45.249.212.191]:5723 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725848AbfICGSH (ORCPT ); Tue, 3 Sep 2019 02:18:07 -0400 Received: from DGGEMS414-HUB.china.huawei.com (unknown [172.30.72.59]) by Forcepoint Email with ESMTP id 92518136F1EDB68BA3F9; Tue, 3 Sep 2019 14:18:05 +0800 (CST) Received: from linux-ibm.site (10.175.102.37) by DGGEMS414-HUB.china.huawei.com (10.3.19.214) with Microsoft SMTP Server id 14.3.439.0; Tue, 3 Sep 2019 14:17:59 +0800 From: zhong jiang To: , CC: , , , , , Subject: [PATCH] drm/amdgpu: remove the redundant null check Date: Tue, 3 Sep 2019 14:15:05 +0800 Message-ID: <1567491305-18320-1-git-send-email-zhongjiang@huawei.com> X-Mailer: git-send-email 1.7.12.4 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.175.102.37] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org debugfs_remove and kfree has taken the null check in account. hence it is unnecessary to check it. Just remove the condition. No functional change. Signed-off-by: zhong jiang --- drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c index 5652cc7..cb94627 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c @@ -1077,8 +1077,7 @@ static int amdgpu_debugfs_ib_preempt(void *data, u64 val) ttm_bo_unlock_delayed_workqueue(&adev->mman.bdev, resched); - if (fences) - kfree(fences); + kfree(fences); return 0; } @@ -1103,8 +1102,7 @@ int amdgpu_debugfs_init(struct amdgpu_device *adev) void amdgpu_debugfs_preempt_cleanup(struct amdgpu_device *adev) { - if (adev->debugfs_preempt) - debugfs_remove(adev->debugfs_preempt); + debugfs_remove(adev->debugfs_preempt); } #else -- 1.7.12.4