[AMD Official Use Only] >-----Original Message----- >From: Yu, Lang <Lang.Yu@xxxxxxx> >Sent: Thursday, October 21, 2021 3:18 PM >To: Grodzovsky, Andrey <Andrey.Grodzovsky@xxxxxxx> >Cc: Deucher, Alexander <Alexander.Deucher@xxxxxxx>; Koenig, Christian ><Christian.Koenig@xxxxxxx>; Huang, Ray <Ray.Huang@xxxxxxx>; Yu, Lang ><Lang.Yu@xxxxxxx> >Subject: [PATCH 3/3] drm/amdgpu: remove unnecessary NULL check in >amdgpu_device.c > >NULL is safe for these functions. > >Signed-off-by: Lang Yu <lang.yu@xxxxxxx> >--- > drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 17 +++++++---------- > 1 file changed, 7 insertions(+), 10 deletions(-) > >diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c >b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c >index be64861ed19a..dd979db93399 100644 >--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c >+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c >@@ -1091,12 +1091,9 @@ static void amdgpu_device_doorbell_fini(struct >amdgpu_device *adev) > */ > static void amdgpu_device_wb_fini(struct amdgpu_device *adev) { >- if (adev->wb.wb_obj) { >- amdgpu_bo_free_kernel(&adev->wb.wb_obj, >- &adev->wb.gpu_addr, >- (void **)&adev->wb.wb); >- adev->wb.wb_obj = NULL; >- } >+ amdgpu_bo_free_kernel(&adev->wb.wb_obj, >+ &adev->wb.gpu_addr, >+ (void **)&adev->wb.wb); > } > > /** >@@ -3794,8 +3791,8 @@ static void amdgpu_device_unmap_mmio(struct >amdgpu_device *adev) > > iounmap(adev->rmmio); > adev->rmmio = NULL; >- if (adev->mman.aper_base_kaddr) >- iounmap(adev->mman.aper_base_kaddr); >+ >+ iounmap(adev->mman.aper_base_kaddr); > adev->mman.aper_base_kaddr = NULL; > > /* Memory manager related */ >@@ -3886,8 +3883,8 @@ void amdgpu_device_fini_sw(struct amdgpu_device >*adev) > > if (IS_ENABLED(CONFIG_PERF_EVENTS)) > amdgpu_pmu_fini(adev); >- if (adev->mman.discovery_bin) >- amdgpu_discovery_fini(adev); >+ >+ amdgpu_discovery_fini(adev); > > amdgpu_device_free_pci_state(adev); > } >-- >2.25.1