Commit fa72d661 authored by Felix Kuehling's avatar Felix Kuehling Committed by Oded Gabbay

drm/amdgpu: remove useless BUG_ONs

Dereferencing NULL pointers will cause a BUG anyway. No need to do
an explicit check.
Signed-off-by: default avatarFelix Kuehling <Felix.Kuehling@amd.com>
Reviewed-by: default avatarChristian König <christian.koenig@amd.com>
Signed-off-by: default avatarOded Gabbay <oded.gabbay@gmail.com>
parent 30d13424
...@@ -212,10 +212,6 @@ int alloc_gtt_mem(struct kgd_dev *kgd, size_t size, ...@@ -212,10 +212,6 @@ int alloc_gtt_mem(struct kgd_dev *kgd, size_t size,
struct kgd_mem **mem = (struct kgd_mem **) mem_obj; struct kgd_mem **mem = (struct kgd_mem **) mem_obj;
int r; int r;
BUG_ON(kgd == NULL);
BUG_ON(gpu_addr == NULL);
BUG_ON(cpu_ptr == NULL);
*mem = kmalloc(sizeof(struct kgd_mem), GFP_KERNEL); *mem = kmalloc(sizeof(struct kgd_mem), GFP_KERNEL);
if ((*mem) == NULL) if ((*mem) == NULL)
return -ENOMEM; return -ENOMEM;
...@@ -269,8 +265,6 @@ void free_gtt_mem(struct kgd_dev *kgd, void *mem_obj) ...@@ -269,8 +265,6 @@ void free_gtt_mem(struct kgd_dev *kgd, void *mem_obj)
{ {
struct kgd_mem *mem = (struct kgd_mem *) mem_obj; struct kgd_mem *mem = (struct kgd_mem *) mem_obj;
BUG_ON(mem == NULL);
amdgpu_bo_reserve(mem->bo, true); amdgpu_bo_reserve(mem->bo, true);
amdgpu_bo_kunmap(mem->bo); amdgpu_bo_kunmap(mem->bo);
amdgpu_bo_unpin(mem->bo); amdgpu_bo_unpin(mem->bo);
......
...@@ -812,8 +812,6 @@ static uint16_t get_fw_version(struct kgd_dev *kgd, enum kgd_engine_type type) ...@@ -812,8 +812,6 @@ static uint16_t get_fw_version(struct kgd_dev *kgd, enum kgd_engine_type type)
struct amdgpu_device *adev = (struct amdgpu_device *) kgd; struct amdgpu_device *adev = (struct amdgpu_device *) kgd;
const union amdgpu_firmware_header *hdr; const union amdgpu_firmware_header *hdr;
BUG_ON(kgd == NULL);
switch (type) { switch (type) {
case KGD_ENGINE_PFP: case KGD_ENGINE_PFP:
hdr = (const union amdgpu_firmware_header *) hdr = (const union amdgpu_firmware_header *)
......
...@@ -775,8 +775,6 @@ static uint16_t get_fw_version(struct kgd_dev *kgd, enum kgd_engine_type type) ...@@ -775,8 +775,6 @@ static uint16_t get_fw_version(struct kgd_dev *kgd, enum kgd_engine_type type)
struct amdgpu_device *adev = (struct amdgpu_device *) kgd; struct amdgpu_device *adev = (struct amdgpu_device *) kgd;
const union amdgpu_firmware_header *hdr; const union amdgpu_firmware_header *hdr;
BUG_ON(kgd == NULL);
switch (type) { switch (type) {
case KGD_ENGINE_PFP: case KGD_ENGINE_PFP:
hdr = (const union amdgpu_firmware_header *) hdr = (const union amdgpu_firmware_header *)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment