drm/amdgpu: remove useless BUG_ONs
authorFelix Kuehling <Felix.Kuehling@amd.com>
Wed, 7 Feb 2018 01:32:30 +0000 (20:32 -0500)
committerOded Gabbay <oded.gabbay@gmail.com>
Wed, 7 Feb 2018 01:32:30 +0000 (20:32 -0500)
Dereferencing NULL pointers will cause a BUG anyway. No need to do
an explicit check.

Signed-off-by: Felix Kuehling <Felix.Kuehling@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Oded Gabbay <oded.gabbay@gmail.com>
drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.c
drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gfx_v7.c
drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gfx_v8.c

index 1d2b6ca82f1d9a51323eeefa6018d532a3c85c02..e06d7919747a758f7a65fe99094981cf65055869 100644 (file)
@@ -212,10 +212,6 @@ int alloc_gtt_mem(struct kgd_dev *kgd, size_t size,
        struct kgd_mem **mem = (struct kgd_mem **) mem_obj;
        int r;
 
-       BUG_ON(kgd == NULL);
-       BUG_ON(gpu_addr == NULL);
-       BUG_ON(cpu_ptr == NULL);
-
        *mem = kmalloc(sizeof(struct kgd_mem), GFP_KERNEL);
        if ((*mem) == NULL)
                return -ENOMEM;
@@ -269,8 +265,6 @@ void free_gtt_mem(struct kgd_dev *kgd, void *mem_obj)
 {
        struct kgd_mem *mem = (struct kgd_mem *) mem_obj;
 
-       BUG_ON(mem == NULL);
-
        amdgpu_bo_reserve(mem->bo, true);
        amdgpu_bo_kunmap(mem->bo);
        amdgpu_bo_unpin(mem->bo);
index a9e6aea0e5f8fd1b68599786827b130ad8befa00..74fcb8b42fd093d093477dba1dd0d74fad144deb 100644 (file)
@@ -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;
        const union amdgpu_firmware_header *hdr;
 
-       BUG_ON(kgd == NULL);
-
        switch (type) {
        case KGD_ENGINE_PFP:
                hdr = (const union amdgpu_firmware_header *)
index b127259d7d8548c0d46b64c4c61ef11c51bb734e..c70c8e1d1863ca484f8870df1e78030a532278b4 100644 (file)
@@ -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;
        const union amdgpu_firmware_header *hdr;
 
-       BUG_ON(kgd == NULL);
-
        switch (type) {
        case KGD_ENGINE_PFP:
                hdr = (const union amdgpu_firmware_header *)