Received: by 2002:a25:d7c1:0:0:0:0:0 with SMTP id o184csp4188302ybg; Tue, 29 Oct 2019 03:32:20 -0700 (PDT) X-Google-Smtp-Source: APXvYqweowfT3Sgw9npXhZxbOhEKZ3+gTUy6vbct92Z9pHMslXC329YZ8aihqzzgzutZ091+7fhV X-Received: by 2002:a17:906:2ada:: with SMTP id m26mr2474233eje.87.1572345140034; Tue, 29 Oct 2019 03:32:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1572345140; cv=none; d=google.com; s=arc-20160816; b=ZOThiVzeFLSbvTJS/K5QbSI702JANyJqFfGvXzs9vzljoDQW/xIdlZvrZbaYY67R2a 0eRHdVm1khJylmRNVCVsCnGtCtzmtw3UlA3ulCBSRWIWEJEInNdu4witg4WvEkMj6DCu tpXWREMByyIT0qgB/nCN4ll8aDs6fr7AywNV4UmjzRLN0L9iue70duwW9KsueBVq+SKg dc6bG0yp9wdcKSbJHwFtyQDBeq9zvdwJHsfiRJF3cia48RyP5Qy5owfxAanqcU59Ty1K O26eGHsY/rfrjiOFHgwvL3YpuQ9SVSH3O0ha1e0eJTd4iXb7rD8t/naJWeVTWTuU7FvH 8ubQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:content-disposition :mime-version:message-id:subject:cc:to:from:date:dkim-signature; bh=VQh5oRSrn/jaJpLx3QrkWsF+eR7SZm+MJ/X6BG8VNCk=; b=vNGxmdCYhcsTeNCU7UgwQFVzCupNdF8I+pFMrRwcAk9c5TqXzNSiEmO2x/SqCxFCZN 74rrb6zwtfWN/hhYiOFSI1uDh+OWWQ0SjX3n2626R66aEW6LeKY3y4D/fK41yOLZDeYN psG+7yyFWiiTdHE9khclw8lxWiyTOP6bUREorbKvZ+ij2hTzUhYTrLETX0Ui5Jt2iZFw CiSkewtD6FjQNWgcsShewCNRYGolnabG4XdJMW4Tge2h6/MyGvRk549umK6HlV9wuibU BVxlNa7Tdxb46TvEs/WjJ0DimXbaz1Jd/kMAIsJ+HgM9KdRHhiDclKU55OMHBPF+C3Gz rRUw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=uxs0uwpF; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d7si10045953eda.429.2019.10.29.03.31.56; Tue, 29 Oct 2019 03:32:20 -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; dkim=pass header.i=@gmail.com header.s=20161025 header.b=uxs0uwpF; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732355AbfJ2JTx (ORCPT + 99 others); Tue, 29 Oct 2019 05:19:53 -0400 Received: from mail-pf1-f196.google.com ([209.85.210.196]:42584 "EHLO mail-pf1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727347AbfJ2JTw (ORCPT ); Tue, 29 Oct 2019 05:19:52 -0400 Received: by mail-pf1-f196.google.com with SMTP id 21so9094871pfj.9 for ; Tue, 29 Oct 2019 02:19:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:mime-version:content-disposition :user-agent; bh=VQh5oRSrn/jaJpLx3QrkWsF+eR7SZm+MJ/X6BG8VNCk=; b=uxs0uwpFgkNBtfpybCdyu7Hxl0sazaEpDe6OVN/XLuv0QfEAaizwFdoXk1N8Ez4U77 FWXhlodBqy63DTFmodqIUg8GsY+BXuMK4A2ShaSNKw/bpOsSxazJtpa0y9ytv6Fmj/t6 93eMignZ/0T+J7QCTWiK4lILtBJ3NiiYtqP1bbYll/OKeLuuUPPyVEMabcMuJ8Qo5VxC XIgTX+YaO1ynvmNWoIUuCmggyj22t/k4mAJ1wSO19GmQ8MoUSxoGiCNSlqrAPHI3BZ74 Kbwnqjww9rwrpPHjsy02EJK8+AMmunuWrZydY70UaPJYSDYg7I4AI79wc89tc4m+FXgj /gKA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:mime-version :content-disposition:user-agent; bh=VQh5oRSrn/jaJpLx3QrkWsF+eR7SZm+MJ/X6BG8VNCk=; b=Eexfb8Erjfp5b9K4oj3aA1cAcTyFuPN3xFgytebBqwyVJIn3/+n3R9NKCvE+070QS4 wbqJyK72cnLxjmQPc7LkuyXAJkmR8gMb2hn5bEuezzc1E8OVYN9249wLk+vTUQ+P1gt3 VKs0jTROG18oT79AxY89BY1n/cSb+9s2dNbNrouf4T/WARuK2L7wElJVJSa5jyxwkFz3 lKO5Xch22tyZCocT+h71h/86zgB0QVrUcJEbecv0tW8eqoheICF3JfX7+pdDC4Bwyvtk eyWPHVG1IcouKf61a9mgb3OGnMDdt5nUAQxg+OiAfU8RIzYb7W5yI9A8YnCfUN9xsoR+ I+Iw== X-Gm-Message-State: APjAAAUAptRwslFH0Knw+1OHNoR7wV7u9hNBfeVlq4YNKguqN0p2YogY lMw7FnSt6MMWgOXMPZB9gLkvMlehAT0= X-Received: by 2002:a62:6411:: with SMTP id y17mr26055073pfb.158.1572340791899; Tue, 29 Oct 2019 02:19:51 -0700 (PDT) Received: from saurav ([27.62.167.137]) by smtp.gmail.com with ESMTPSA id i7sm1691256pjs.1.2019.10.29.02.19.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 29 Oct 2019 02:19:51 -0700 (PDT) Date: Tue, 29 Oct 2019 14:49:43 +0530 From: Saurav Girepunje To: alexander.deucher@amd.com, christian.koenig@amd.com, David1.Zhou@amd.com, airlied@linux.ie, daniel@ffwll.ch, tom.stdenis@amd.com, xywang.sjtu@sjtu.edu.cn, Jack.Xiao@amd.com, sam@ravnborg.org, Kevin1.Wang@amd.com, saurav.girepunje@gmail.com, amd-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org Cc: saurav.girepunje@hotmail.com Subject: [PATCH] drm: amd: amdgpu: Remove NULL check not needed before freeing functions Message-ID: <20191029091943.GA10258@saurav> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Remove unneeded NULL check before freeing functions kfree and debugfs_remove. Signed-off-by: Saurav Girepunje --- 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 5652cc72ed3a..cb94627fc0f4 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 -- 2.20.1