diff options
author | Felix Kuehling <Felix.Kuehling@amd.com> | 2017-08-16 06:00:09 +0300 |
---|---|---|
committer | Oded Gabbay <oded.gabbay@gmail.com> | 2017-08-16 06:00:09 +0300 |
commit | 4f52f2256eae0b8495c308b78a7edf4094e3dd67 (patch) | |
tree | e6bffdeea67f722dea2745d8f12d662c3097218d /drivers/gpu/drm/amd/amdkfd/kfd_device.c | |
parent | dbf56ab11a09550c00edb84fc4b2197350154e99 (diff) | |
download | linux-4f52f2256eae0b8495c308b78a7edf4094e3dd67.tar.xz |
drm/amdkfd: Remove BUG_ONs for NULL pointer arguments
Remove BUG_ONs that check for NULL pointer arguments that are
dereferenced in the same function. Dereferencing the NULL pointer
will generate a BUG anyway, so the explicit check is redundant and
unnecessary overhead.
Signed-off-by: Felix Kuehling <Felix.Kuehling@amd.com>
Reviewed-by: Oded Gabbay <oded.gabbay@gmail.com>
Signed-off-by: Oded Gabbay <oded.gabbay@gmail.com>
Diffstat (limited to 'drivers/gpu/drm/amd/amdkfd/kfd_device.c')
-rw-r--r-- | drivers/gpu/drm/amd/amdkfd/kfd_device.c | 10 |
1 files changed, 0 insertions, 10 deletions
diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_device.c b/drivers/gpu/drm/amd/amdkfd/kfd_device.c index d962342a2e3e..e28e8183a452 100644 --- a/drivers/gpu/drm/amd/amdkfd/kfd_device.c +++ b/drivers/gpu/drm/amd/amdkfd/kfd_device.c @@ -341,8 +341,6 @@ void kgd2kfd_device_exit(struct kfd_dev *kfd) void kgd2kfd_suspend(struct kfd_dev *kfd) { - BUG_ON(!kfd); - if (kfd->init_complete) { kfd->dqm->ops.stop(kfd->dqm); amd_iommu_set_invalidate_ctx_cb(kfd->pdev, NULL); @@ -356,8 +354,6 @@ int kgd2kfd_resume(struct kfd_dev *kfd) unsigned int pasid_limit; int err; - BUG_ON(kfd == NULL); - pasid_limit = kfd_get_pasid_limit(); if (kfd->init_complete) { @@ -394,8 +390,6 @@ static int kfd_gtt_sa_init(struct kfd_dev *kfd, unsigned int buf_size, { unsigned int num_of_bits; - BUG_ON(!kfd); - BUG_ON(!kfd->gtt_mem); BUG_ON(buf_size < chunk_size); BUG_ON(buf_size == 0); BUG_ON(chunk_size == 0); @@ -445,8 +439,6 @@ int kfd_gtt_sa_allocate(struct kfd_dev *kfd, unsigned int size, { unsigned int found, start_search, cur_size; - BUG_ON(!kfd); - if (size == 0) return -EINVAL; @@ -551,8 +543,6 @@ int kfd_gtt_sa_free(struct kfd_dev *kfd, struct kfd_mem_obj *mem_obj) { unsigned int bit; - BUG_ON(!kfd); - /* Act like kfree when trying to free a NULL object */ if (!mem_obj) return 0; |