[PATCH][next] drm/amd/display: Remove redundant initialization of variable result

2021-10-07 Thread Colin King
From: Colin Ian King The variable result is being initialized with a value that is never read, it is being updated immediately afterwards in both branches of an if statement. The assignment is redundant and can be removed. Addresses-Coverity: ("Unused value") Signed-off-by: Colin Ian King ---

[PATCH] drm/radeon: make array encoded_lanes static

2021-09-15 Thread Colin King
From: Colin Ian King Don't populate the read-only array encoded_lanes on the stack but instead it static. Also makes the object code smaller by 97 bytes: Before: textdatabss dechex filename 388998064 0 46963 b773 ./drivers/gpu/drm/radeon/r600_dpm.o After:

[PATCH] drm/radeon/ci_dpm: Remove redundant initialization of variables hi_sidd, lo_sidd

2021-09-07 Thread Colin King
From: Colin Ian King The variables hi_sidd and lo_sidd are being initialized with a values that are never read, they are being updated later on. The assignments are redundant and can be removed. Addresses-Coverity: ("Unused value") Signed-off-by: Colin Ian King ---

[PATCH][next] drm/amdgpu: sdma: clean up identation

2021-09-02 Thread Colin King
From: Colin Ian King There is a statement that is indented incorrectly. Clean it up. Signed-off-by: Colin Ian King --- drivers/gpu/drm/amd/amdgpu/sdma_v5_2.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/amd/amdgpu/sdma_v5_2.c

[PATCH][next] drm/amdgpu: clean up inconsistent indenting

2021-09-02 Thread Colin King
From: Colin Ian King There are a couple of statements that are indented one character too deeply, clean these up. Signed-off-by: Colin Ian King --- drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c | 7 +++ 1 file changed, 3 insertions(+), 4 deletions(-) diff --git

[PATCH][next] drm/amd/display: Fix unused initialization of pointer sink

2021-08-30 Thread Colin King
From: Colin Ian King Pointer sink is being inintialized with a value that is never read, it is later being re-assigned a new value. Remove the redundant initialization. Addresses-Coverity: ("Unused value") Signed-off-by: Colin Ian King --- drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 2

[PATCH] drm/amdgpu/swsmu: fix spelling mistake "minimun" -> "minimum"

2021-08-27 Thread Colin King
From: Colin Ian King There are three identical spelling mistakes in dev_err messages. Fix these. Signed-off-by: Colin Ian King --- drivers/gpu/drm/amd/pm/swsmu/smu11/vangogh_ppt.c | 2 +- drivers/gpu/drm/amd/pm/swsmu/smu12/renoir_ppt.c | 2 +-

[PATCH][next] drm/amd/display: fix spelling mistake "alidation" -> "validation"

2021-08-25 Thread Colin King
From: Colin Ian King There is a spelling mistake in a DC_LOG_WARNING message. Fix it. Signed-off-by: Colin Ian King --- drivers/gpu/drm/amd/display/dc/dcn31/dcn31_resource.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git

[PATCH][next] drm/amd/pm: Fix spelling mistake "firwmare" -> "firmware"

2021-08-17 Thread Colin King
From: Colin Ian King There is a spelling mistake in a dev_err error message. Fix it. Signed-off-by: Colin Ian King --- drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0.c

[PATCH] drm/amd/display: Remove redundant initialization of variable eng_id

2021-08-06 Thread Colin King
From: Colin Ian King The variable eng_id is being initialized with a value that is never read, it is being re-assigned on the next statment. The assignment is redundant and can be removed. Addresses-Coverity: ("Unused value") Signed-off-by: Colin Ian King ---

[PATCH] drm/amdgpu/display: make a const array common_rates static, makes object smaller

2021-07-15 Thread Colin King
From: Colin Ian King Don't populate the const array common_rates on the stack but instead it static. Makes the object code smaller by 80 bytes: Before: textdata bss dec hex filename 268019 98322 256 366597 59805 ../display/amdgpu_dm/amdgpu_dm.o After: text

[PATCH] drm/amd/powerplay: remove redundant assignment to usTMax

2021-07-14 Thread Colin King
From: Colin Ian King Struct element usTMax is being assigned a hard coded value that is never read and it is being re-assigned a new value immediately afterwards. The assignment is redundant and can be removed. Addresses-Coverity: ("Unused value") Signed-off-by: Colin Ian King ---

[PATCH][next] drm/amd/display: Fix two spelling mistakes, clean wide lines

2021-06-07 Thread Colin King
From: Colin Ian King There are two spelling mistakes in dml_print messages, fix these and clear up checkpatch warning on overly wide line length. Signed-off-by: Colin Ian King --- .../drm/amd/display/dc/dml/dcn31/display_mode_vba_31.c | 10 ++ 1 file changed, 6 insertions(+), 4

[PATCH] drm/amd/display: remove variable active_disp

2021-06-03 Thread Colin King
From: Colin Ian King The variable active_disp is being initialized with a value that is never read, it is being re-assigned immediately afterwards. Clean up the code by removing the need for variable active_disp. Addresses-Coverity: ("Unused value") Signed-off-by: Colin Ian King ---

[PATCH] drm/amdgpu: remove redundant assignment of variable k

2021-06-03 Thread Colin King
From: Colin Ian King The variable k is being assigned a value that is never read, the assignment is redundant and can be removed. Addresses-Coverity: ("Unused value") Signed-off-by: Colin Ian King --- drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c | 2 +- 1 file changed, 1 insertion(+), 1

[PATCH][next] drm/amdgpu/acpi: Fix null check on memory allocation

2021-05-20 Thread Colin King
From: Colin Ian King The current null check is checking the wrong pointer atif. Fix this to check the correct pointer atcs. Addresses-Coverity: ("Uninitialized pointer read") Fixes: c1c4d8efddde ("drm/amdgpu/acpi: unify ATCS handling (v2)") Signed-off-by: Colin Ian King ---

[PATCH][next] drm/amdkfd: Fix spelling mistake "unregisterd" -> "unregistered"

2021-04-26 Thread Colin King
From: Colin Ian King There is a spelling mistake in a pr_debug message. Fix it. Signed-off-by: Colin Ian King --- drivers/gpu/drm/amd/amdkfd/kfd_svm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_svm.c

[PATCH][next] drm/amdkfd: remove redundant initialization to variable r

2021-04-22 Thread Colin King
From: Colin Ian King The variable r is being initialized with a value that is never read and it is being updated later with a new value. The initialization is redundant and can be removed. Addresses-Coverity: ("Unused value") Signed-off-by: Colin Ian King ---

[PATCH][next] drm/amdkfd: fix uint32 variable compared to less than zero

2021-04-22 Thread Colin King
From: Colin Ian King Currently the call to kfd_process_gpuidx_from_gpuid is returning an int value and this is being assigned to a uint32_t variable gpuidx and this is being checked for a negative error return which is always going to be false. Fix this by making gpuidx an int32_t. This makes

[PATCH] drm/amdgpu/pm: use linux/processor.h instead of asm/processor.h

2021-04-16 Thread Colin King
From: Colin Ian King Checkpatch reported that linux/processor.h should be included instead of the asm variant. Fix this to clean up the warning. Signed-off-by: Colin Ian King --- drivers/gpu/drm/amd/pm/amdgpu_pm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git

[PATCH][next] drm/amd/display: remove redundant initialization of variable status

2021-03-31 Thread Colin King
From: Colin Ian King The variable status is being initialized with a value that is never read and it is being updated later with a new value. The initialization is redundant and can be removed. Also clean up an indentation. Addresses-Coverity: ("Unused value") Signed-off-by: Colin Ian King ---

[PATCH][next] drm/amd/display/dc/calcs/dce_calcs: Fix allocation size for dceip and vbios

2021-03-23 Thread Colin King
From: Colin Ian King Currently the allocations for dceip and vbios are based on the size of the pointer rather than the size of the data structures, causing heap issues. Fix this by using the correct allocation sizes. Addresses-Coverity: ("Wrong size of argument") Fixes: a2a855772210

[PATCH][next] drm/amd/pm: Fix spelling mistake "disble" -> "disable"

2021-03-12 Thread Colin King
From: Colin Ian King There is a spelling mistake in an assert message. Fix it. Signed-off-by: Colin Ian King --- drivers/gpu/drm/amd/pm/powerplay/hwmgr/smu7_hwmgr.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/amd/pm/powerplay/hwmgr/smu7_hwmgr.c

[PATCH] drm/amd/display: remove redundant initialization of variable result

2021-03-11 Thread Colin King
From: Colin Ian King The variable result is being initialized with a value that is never read and it is being updated later with a new value. The initialization is redundant and can be removed. Addresses-Coverity: ("Unused value") Signed-off-by: Colin Ian King ---

[PATCH][next] drm/amdgpu: Fix spelling mistake "disabed" -> "disabled"

2021-03-11 Thread Colin King
From: Colin Ian King There is a spelling mistake in a drm debug message. Fix it. Signed-off-by: Colin Ian King --- drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c

[PATCH][next] drm/amd/display: remove redundant initialization of variable status

2021-03-03 Thread Colin King
From: Colin Ian King The variable status is being initialized with a value that is never read and it is being updated later with a new value. The initialization is redundant and can be removed. Addresses-Coverity: ("Unused value") Signed-off-by: Colin Ian King ---

[PATCH][next] drm/amdgpu/display: remove redundant continue statement

2021-03-03 Thread Colin King
From: Colin Ian King The continue statement in a for-loop is redudant and can be removed. Clean up the code to address this. Addresses-Coverity: ("Continue as no effect") Fixes: b6f91fc183f7 ("drm/amdgpu/display: buffer INTERRUPT_LOW_IRQ_CONTEXT interrupt work") Signed-off-by: Colin Ian King

[PATCH] drm/radeon: fix copy of uninitialized variable back to userspace

2021-03-02 Thread Colin King
From: Colin Ian King Currently the ioctl command RADEON_INFO_SI_BACKEND_ENABLED_MASK can copy back uninitialised data in value_tmp that pointer *value points to. This can occur when rdev->family is less than CHIP_BONAIRE and less than CHIP_TAHITI. Fix this by adding in a missing -EINVAL so that

[PATCH][next] drm/amd/display: fix the return of the uninitialized value in ret

2021-03-02 Thread Colin King
From: Colin Ian King Currently if stream->signal is neither SIGNAL_TYPE_DISPLAY_PORT_MST or SIGNAL_TYPE_DISPLAY_PORT then variable ret is uninitialized and this is checked for > 0 at the end of the function. Ret should be initialized, I believe setting it to zero is a correct default.

[PATCH][next] drm/amd/pm: fix spelling mistake in various messages "power_dpm_force_perfomance_level"

2021-02-10 Thread Colin King
From: Colin Ian King There are spelling mistakes in error and warning messages, the text power_dpm_force_perfomance_level is missing a letter r and should be power_dpm_force_performance_level. Fix them. Signed-off-by: Colin Ian King --- drivers/gpu/drm/amd/pm/powerplay/hwmgr/smu10_hwmgr.c |

[PATCH] drm/amdgpu: fix potential integer overflow on shift of a int

2021-02-08 Thread Colin King
From: Colin Ian King The left shift of int 32 bit integer constant 1 is evaluated using 32 bit arithmetic and then assigned to an unsigned 64 bit integer. In the case where *frag is 32 or more this can lead to an oveflow. Avoid this by shifting 1ULL. Addresses-Coverity: ("Unintentional integer

[PATCH][next] drm/amdgpu: Fix memory leak of object caps on error return paths

2021-01-29 Thread Colin King
From: Colin Ian King Currently there are three error return paths that don't kfree object caps. Fix this by performing the allocation of caps after the checks and error return paths to avoid the premature allocation and memory leaking. Addresses-Coverity: ("Resource leak") Fixes: 555fc7fbb2a2

[PATCH][next] drm/amdgpu: Fix masking binary not operator on two mask operations

2021-01-22 Thread Colin King
From: Colin Ian King Currently the ! operator is incorrectly being used to flip bits on mask values. Fix this by using the bit-wise ~ operator instead. Addresses-Coverity: ("Logical vs. bitwise operator") Fixes: 3c9a7b7d6e75 ("drm/amdgpu: update mmhub mgcg for mmhub_v2_3") Signed-off-by: Colin

[PATCH][next] drm/amd/display: Fix spelling mistake of function name

2021-01-20 Thread Colin King
From: Colin Ian King There are two spelling mistakes of the function name, fix this by using __func__ instead of a hard coded name string. Signed-off-by: Colin Ian King --- drivers/gpu/drm/amd/display/dc/core/dc_link.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git

[PATCH][next] drm/amdgpu: Add missing BOOTUP_DEFAULT to profile_name[]

2021-01-11 Thread Colin King
From: Colin Ian King A recent change added a new BOOTUP_DEFAULT power profile mode to the PP_SMC_POWER_PROFILE enum but omitted updating the corresponding profile_name array. Fix this by adding in the missing BOOTUP_DEFAULT to profile_name[]. Addresses-Coverity: ("Out-of-bounds read") Fixes:

[PATCH] drm/amdgpu: Fix spelling mistake "Heterogenous" -> "Heterogeneous"

2020-12-15 Thread Colin King
From: Colin Ian King There is a spelling mistake in a comment in the Kconfig. Fix it. Signed-off-by: Colin Ian King --- drivers/gpu/drm/amd/amdkfd/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/amd/amdkfd/Kconfig

[PATCH][next] drm/amdgpu: Fix sizeof() mismatch in bps_bo kmalloc_array creation

2020-11-25 Thread Colin King
From: Colin Ian King An incorrect sizeof() is being used, sizeof((*data)->bps_bo) is not correct, it should be sizeof(*(*data)->bps_bo). It just so happens to work because the sizes are the same. Fix it. Addresses-Coverity: ("Sizeof not portable (SIZEOF_MISMATCH)") Fixes: 5278a159cf35

[PATCH] drm/amd/powerplay: fix spelling mistake "smu_state_memroy_block" -> "smu_state_memory_block"

2020-11-23 Thread Colin King
From: Colin Ian King The struct name smu_state_memroy_block contains a spelling mistake, rename it to smu_state_memory_block Fixes: 8554e67d6e22 ("drm/amd/powerplay: implement power_dpm_state sys interface for SMU11") Signed-off-by: Colin Ian King --- drivers/gpu/drm/amd/pm/inc/amdgpu_smu.h

[PATCH][next] drm/amd/pm: fix spelling mistakes in dev_warn messages

2020-11-17 Thread Colin King
From: Colin Ian King There are two spelling mistakes in dev_warn messages. Fix these. Signed-off-by: Colin Ian King --- drivers/gpu/drm/amd/pm/swsmu/smu11/vangogh_ppt.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/amd/pm/swsmu/smu11/vangogh_ppt.c

[PATCH][next] drm/amdgpu: fix spelling mistake: "Successed" -> "Succeeded"

2020-11-02 Thread Colin King
From: Colin Ian King There is a spelling mistake in a deb_dbg message. Fix it. Signed-off-by: Colin Ian King --- drivers/gpu/drm/amd/amdgpu/amdgpu_vram_mgr.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vram_mgr.c

[PATCH][next] drm/amd/pm: fix out-of-bound read on pptable->SkuReserved

2020-10-28 Thread Colin King
From: Colin Ian King A recent change added two uint16_t elements to PPTable_t and reduced the uint32_t array down to 8 elements. This results in the dev_info printing of pptable->SkuReserved[8] accessing a value that is out-of-range on array SkuReserved. The array has been shrunk by 1 element,

[PATCH][next] drm/amdgpu/swsmu: fix potential uint32_t multiplication overflow

2020-08-27 Thread Colin King
From: Colin Ian King The calculation of tmp64 is performed using a 32 bit multiply and then is stored in the uint64_t variable tmp64. This indicates that a 64 bit result may be expected, so cast crystal_clock_freq to a uint64_t to ensure a 64 bit multiplication is being performed to avoid any

[PATCH][next] drm/amd/display: fix potential integer overflow when shifting 32 bit variable bl_pwm

2020-08-18 Thread Colin King
From: Colin Ian King The 32 bit unsigned integer bl_pwm is being shifted using 32 bit arithmetic and then being assigned to a 64 bit unsigned integer. There is a potential for a 32 bit overflow so cast bl_pwm to enforce a 64 bit shift operation to avoid this. Addresses-Coverity:

[PATCH][next] drm/amdgpu: fix spelling mistake "paramter" -> "parameter"

2020-08-05 Thread Colin King
From: Colin Ian King There is a spelling mistake in a dev_warn message. Fix it. Signed-off-by: Colin Ian King --- drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c

[PATCH] drm/amdgpu: fix spelling mistake "Falied" -> "Failed"

2020-08-05 Thread Colin King
From: Colin Ian King There is a spelling mistake in a DRM_ERROR message. Fix it. Signed-off-by: Colin Ian King --- drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c

[PATCH][next] drm/amd/display: fix spelling mistake "Usupported" -> "Unsupported"

2020-08-04 Thread Colin King
From: Colin Ian King There are spelling mistakes in two DRM_ERROR error messages. Fix them. Signed-off-by: Colin Ian King --- drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git

[PATCH][next] drm/amdgpu: fix spelling mistake "Falied" -> "Failed"

2020-07-24 Thread Colin King
From: Colin Ian King There is a spelling mistake in a DRM_ERROR error message. Fix it. Signed-off-by: Colin Ian King --- Can folk please use checkpatch, it should catch these errors. --- drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff

[PATCH] drm/amd/display: remove redundant initialization of variable result

2020-07-23 Thread Colin King
From: Colin Ian King The variable result is being initialized with a value that is never read and it is being updated later with a new value. The initialization is redundant and can be removed. Signed-off-by: Colin Ian King --- drivers/gpu/drm/amd/display/dc/dce112/dce112_resource.c | 2 +-

[PATCH][next] drm/amdgpu: fix spelling mistake "Falied" -> "Failed"

2020-07-10 Thread Colin King
From: Colin Ian King There is a spelling mistake in a DRM_ERROR error message. Fix it. Signed-off-by: Colin Ian King --- drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c

[PATCH] drm/amd/display: remove redundant initialization of variable result

2020-07-01 Thread Colin King
From: Colin Ian King The variable result is being initialized with a value that is never read and it is being updated later with a new value. The initialization is redundant and can be removed. Addresses-Coverity: ("Unused value") Signed-off-by: Colin Ian King ---

[PATCH][next] drm/amdgpu: ensure 0 is returned for success in jpeg_v2_5_wait_for_idle

2020-06-24 Thread Colin King
From: Colin Ian King In the cases where adev->jpeg.num_jpeg_inst is zero or the condition adev->jpeg.harvest_config & (1 << i) is always non-zero the variable ret is never set to an error condition and the function returns an uninitialized value in ret. Since the only exit condition at the end

[PATCH][next] drm: amdgpu: fix premature goto because of missing braces

2020-06-24 Thread Colin King
From: Colin Ian King Currently the goto statement is skipping over a lot of setup code because it is outside of an if-block and should be inside it. Fix this by adding missing if statement braces. Addresses-Coverity: ("Structurally dead code") Fixes: fd151ca5396d ("drm amdgpu: SI UVD v3_1")

[PATCH] drm/radeon: fix array out-of-bounds read and write issues

2020-06-24 Thread Colin King
From: Colin Ian King There is an off-by-one bounds check on the index into arrays table->mc_reg_address and table->mc_reg_table_entry[k].mc_data[j] that can lead to reads and writes outside of arrays. Fix the bound checking off-by-one error. Addresses-Coverity: ("Out-of-bounds read/write")

[PATCH] drm/amdgpu: remove redundant initialization of variable ret

2020-06-18 Thread Colin King
From: Colin Ian King The variable ret is being initialized with a value that is never read and it is being updated later with a new value. The initialization is redundant and can be removed. Addresses-Coverity: ("Unused value") Signed-off-by: Colin Ian King ---

[PATCH][next] drm/amd/display: fix spelling mistake: "propogation" -> "propagation"

2020-06-04 Thread Colin King
From: Colin Ian King There is a spelling mistake in a dml_print message. Fix it. Signed-off-by: Colin Ian King --- drivers/gpu/drm/amd/display/dc/dml/dcn30/display_mode_vba_30.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git

[PATCH][next] drm/amdkfd: fix a dereference of pdd before it is null checked

2020-05-29 Thread Colin King
From: Colin Ian King Currently pointer pdd is being dereferenced when assigning pointer dpm and then pdd is being null checked. Fix this by checking if pdd is null before the dereference of pdd occurs. Addresses-Coverity: ("Dereference before null check") Fixes: 522b89c63370 ("drm/amdkfd:

[PATCH][next] drm/amdgpu: remove redundant assignment to variable ret

2020-05-12 Thread Colin King
From: Colin Ian King The variable ret is being initializeed with a value that is never read and it is being updated later with a new value. The initialization is redundant and can be removed. Addresses-Coverity: ("Unused value") Signed-off-by: Colin Ian King ---

[PATCH][next] drm/amdgpu: fix unlocks on error return path

2020-04-24 Thread Colin King
From: Colin Ian King Currently the error returns paths are unlocking lock kiq->ring_lock however it seems this should be dev->gfx.kiq.ring_lock as this is the lock that is being locked and unlocked around the ring operations. This looks like a bug, fix it by unlocking the correct lock. [ Note:

[PATCH] amdgpu/dc: remove redundant assignment to variable 'option'

2020-04-24 Thread Colin King
From: Colin Ian King The variable option is being initialized with a value that is never read and it is being updated later with a new value. The initialization is redundant and can be removed. Addresses-Coverity: ("Unused value") Signed-off-by: Colin Ian King ---

[PATCH][next] drm/amd/display: remove redundant assignment to variable ret

2020-04-23 Thread Colin King
From: Colin Ian King The variable ret is being initialized with a value that is never read and it is being updated later with a new value. The initialization is redundant and can be removed. Addresses-Coverity: ("Unused value") Signed-off-by: Colin Ian King ---

[PATCH][next] drm/amd/display: fix incorrect assignment due to a typo

2020-04-23 Thread Colin King
From: Colin Ian King The assignment to infopacket->sb[7] looks incorrect, the comment states it is the minimum refresh rate yet it is being assigned a value from the maximum refresh rate max_refresh_in_uhz. Fix this by using min_refresh_in_uhz instead. Addresses-Coverity: ("Copy-paste error")

[PATCH][next] drm/amdgpu: fix a dereference on pointer hive before it is null checked

2020-04-20 Thread Colin King
From: Colin Ian King Currently pointer hive is being dereferenced before it is being null checked and hence can lead to null pointer dereference issues. Fix this by only dereferencing pointer hive after it has been null checked. Addresses-Coverity: ("Dereference before null check") Fixes:

[PATCH] drm/amdgpu: ensure device_list is initialised before calling list_add_tail

2020-04-11 Thread Colin King
From: Colin Ian King Currently the call to list_add_tail will access an the uninitalised device_list.prev. Fix this by ensuring device_list is initialized before adding items to it. Addresses-Coverity: ("Uninitialized pointer read") Fixes: b3dbd6d3ec49 ("drm/amdgpu: resolve mGPU RAS query

[PATCH] drm/amd/display: remove redundant assignment to variable dp_ref_clk_khz

2020-04-10 Thread Colin King
From: Colin Ian King The variable dp_ref_clk_khz is being initialized with a value that is never read and it is being updated later with a new value. The initialization is redundant and can be removed. Addresses-Coverity: ("Unused value") Signed-off-by: Colin Ian King ---

[PATCH][next] drm/amdgpu/vcn: fix spelling mistake "fimware" -> "firmware"

2020-04-01 Thread Colin King
From: Colin Ian King There is a spelling mistake in a dev_err error message. Fix it. Signed-off-by: Colin Ian King --- drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c

[PATCH][next] drm: amd: fix spelling mistake "shoudn't" -> "shouldn't"

2020-03-17 Thread Colin King
From: Colin Ian King There are spelling mistakes in pr_err messages and a comment. Fix these. Signed-off-by: Colin Ian King --- drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c | 2 +- drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c| 2 +- drivers/gpu/drm/amd/amdkfd/kfd_flat_memory.c | 2 +- 3

[PATCH][next] drm/amdkfd: fix indentation issue

2020-02-28 Thread Colin King
From: Colin Ian King There is a statement that is indented with spaces instead of a tab. Replace spaces with a tab. Signed-off-by: Colin Ian King --- drivers/gpu/drm/amd/amdkfd/kfd_topology.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git

[PATCH][next] drm/amd/display: fix indentation issue on a hunk of code

2020-02-28 Thread Colin King
From: Colin Ian King There are multiple statements that are indented incorrectly. Add in the missing tabs. Signed-off-by: Colin Ian King --- .../gpu/drm/amd/display/dc/calcs/dce_calcs.c | 46 +-- 1 file changed, 23 insertions(+), 23 deletions(-) diff --git

[PATCH] drm/amd/display: fix spelling mistake link_integiry_check -> link_integrity_check

2020-01-28 Thread Colin King
From: Colin Ian King There is a spelling mistake on the struct field name link_integiry_check, fix this by renaming it. Signed-off-by: Colin Ian King --- drivers/gpu/drm/amd/display/modules/hdcp/hdcp.h | 2 +- .../gpu/drm/amd/display/modules/hdcp/hdcp1_execution.c| 8

[PATCH] drm/amd/powerplay: fix spelling mistake "Attemp" -> "Attempt"

2020-01-27 Thread Colin King
From: Colin Ian King There are several spelling mistakes in PP_ASSERT_WITH_CODE messages. Fix these. Signed-off-by: Colin Ian King --- drivers/gpu/drm/amd/powerplay/smumgr/vega12_smumgr.c | 12 ++-- drivers/gpu/drm/amd/powerplay/smumgr/vega20_smumgr.c | 12 ++-- 2 files

[PATCH] drm/amd/amdgpu: fix spelling mistake "to" -> "too"

2020-01-23 Thread Colin King
From: Colin Ian King There is a spelling mistake in a DRM_ERROR message. Fix it. Signed-off-by: Colin Ian King --- drivers/gpu/drm/amd/amdgpu/amdgpu_vce.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vce.c

[PATCH][next] drm/amd/display: fix for-loop with incorrectly sized loop counter

2020-01-17 Thread Colin King
From: Colin Ian King A for-loop is iterating from 0 up to 1000 however the loop variable count is a u8 and hence not large enough. Fix this by making count an int. Also remove the redundant initialization of count since this is never used and add { } on the loop statement make the loop block

[PATCH][next] drm/amd/powerplay: fix various dereferences of a pointer before it is null checked

2019-12-12 Thread Colin King
From: Colin Ian King There are several occurrances of the pointer hwmgr being dereferenced before it is null checked. Fix these by performing the dereference of hwmgr after it has been null checked. Addresses-Coverity: ("Dereference before null check") Fixes: 8497d2bcdee1 ("drm/amd/powerplay:

[PATCH] drm/amd/display: remove redundant assignment to variable v_total

2019-12-02 Thread Colin King
From: Colin Ian King The variable v_total is being initialized with a value that is never read and it is being updated later with a new value. The initialization is redundant and can be removed. Addresses-Coverity: ("Unused value") Signed-off-by: Colin Ian King ---

[PATCH] drm/amd/powerplay: remove redundant assignment to variables HiSidd and LoSidd

2019-11-23 Thread Colin King
From: Colin Ian King The variables HiSidd and LoSidd are being initialized with values that are never read and are being updated a little later with a new value. The initialization is redundant and can be removed. Addresses-Coverity: ("Unused value") Signed-off-by: Colin Ian King ---

[PATCH] drm/radeon: remove redundant assignment to variable ret

2019-11-23 Thread Colin King
From: Colin Ian King The variable ret is being initialized with a value that is never read and it is being updated later with a new value. The initialization is redundant and can be removed. Addresses-Coverity: ("Unused value") Signed-off-by: Colin Ian King --- drivers/gpu/drm/radeon/si_dpm.c

[PATCH][next] drm/amdgpu: remove redundant assignment to pointer write_frame

2019-11-21 Thread Colin King
From: Colin Ian King The pointer write_frame is being initialized with a value that is never read and it is being updated later with a new value. The initialization is redundant and can be removed. Addresses-Coverity: ("Unused value") Signed-off-by: Colin Ian King ---

[PATCH][next] drm/amd/display: fix double assignment to msg_id field

2019-11-20 Thread Colin King
From: Colin Ian King The msg_id field is being assigned twice. Fix this by replacing the second assignment with an assignment to msg_size. Addresses-Coverity: ("Unused value") Fixes: 11a00965d261 ("drm/amd/display: Add PSP block to verify HDCP2.2 steps") Signed-off-by: Colin Ian King ---

[PATCH][next] drm/amdgpu/powerplay: fix dereference before null check of pointer hwmgr

2019-11-15 Thread Colin King
From: Colin Ian King The assignment of adev dereferences pointer hwmgr before hwmgr is null checked, hence there is a potential null pointer deference issue. Fix this by assigning adev after the null check. Addresses-Coverity: ("Dereference before null check") Fixes: 0896d2f7ba4d

[PATCH][next] drm/amd/display: fix spelling mistake "exeuction" -> "execution"

2019-11-11 Thread Colin King
From: Colin Ian King There are spelling mistakes in a DC_ERROR message and a comment. Fix these. Signed-off-by: Colin Ian King --- drivers/gpu/drm/amd/display/dc/dc_dmub_srv.c| 2 +- drivers/gpu/drm/amd/display/dmub/inc/dmub_srv.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)

[PATCH] drm/amd/display: remove duplicated comparison expression

2019-11-11 Thread Colin King
From: Colin Ian King There is comparison expression that is duplicated and hence one of the expressions can be removed. Remove it. Addresses-Coverity: ("Same on both sides") Fixes: 12e2b2d4c65f ("drm/amd/display: add dcc programming for dual plane") Signed-off-by: Colin Ian King ---

[PATCH][next] drm/amd/display: remove redundant variable status

2019-11-08 Thread Colin King
From: Colin Ian King Variable status is redundant, it is being initialized with a value that is over-written later and this is being returned immediately after the assignment. Clean up the code by removing status and just returning the value returned from the call to function

[PATCH][next] drm/amd/display: fix dereference of pointer aconnector when it is null

2019-11-08 Thread Colin King
From: Colin Ian King Currently pointer aconnector is being dereferenced by the call to to_dm_connector_state before it is being null checked, this could lead to a null pointer dereference. Fix this by checking that aconnector is null before dereferencing it. Addresses-Coverity: ("Dereference

[PATCH][next] drm/amd/display: fix unsigned less than 0 comparison on error check

2019-11-08 Thread Colin King
From: Colin Ian King Currently the error check on the call to drm_dp_atomic_find_vcpi_slots is always false because an unsigned dm_new_connector_state->vcpi_slots is being checked for a less than zero. Fix this by casting this to an int on the comparison. Addresses-Coverity: ("Unsigned compared

[PATCH][next] drm/amd/display: remove duplicated assignment to grph_obj_type

2019-11-08 Thread Colin King
From: Colin Ian King Variable grph_obj_type is being assigned twice, one of these is redundant so remove it. Addresses-Coverity: ("Evaluation order violation") Signed-off-by: Colin Ian King --- drivers/gpu/drm/amd/amdgpu/amdgpu_atombios.c | 3 +-- 1 file changed, 1 insertion(+), 2

[PATCH] drm/amd/powerplay: fix spelling mistake "Attemp" -> "Attempt"

2019-11-03 Thread Colin King
From: Colin Ian King There are spelling mistakes in assert messages, fix these. Signed-off-by: Colin Ian King --- drivers/gpu/drm/amd/powerplay/smumgr/vega12_smumgr.c | 12 ++-- drivers/gpu/drm/amd/powerplay/smumgr/vega20_smumgr.c | 12 ++-- 2 files changed, 12 insertions(+),

[PATCH][next] drm/amdgpu/psp: fix spelling mistake "initliaze" -> "initialize"

2019-10-18 Thread Colin King
From: Colin Ian King There is a spelling mistake in a DRM_ERROR error message. Fix it. Signed-off-by: Colin Ian King --- drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c

[PATCH] drm/amdgpu/display: make various arrays static, makes object smaller

2019-10-07 Thread Colin King
From: Colin Ian King Don't populate the arrays on the stack but instead make them static. Makes the object code smaller by 158 bytes. Before: textdata bss dec hex filename 324682072 0 3454086ec display/dc/bios/bios_parser.o 221981088 0 23286

[PATCH] drm/amdkfd: add missing void argument to function kgd2kfd_init

2019-10-05 Thread Colin King
From: Colin Ian King Function kgd2kfd_init is missing a void argument, add it to clean up the non-ANSI function declaration. Signed-off-by: Colin Ian King --- drivers/gpu/drm/amd/amdkfd/kfd_module.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git

[PATCH][next] drm/amdgpu: fix uninitialized variable pasid_mapping_needed

2019-10-03 Thread Colin King
From: Colin Ian King The boolean variable pasid_mapping_needed is not initialized and there are code paths that do not assign it any value before it is is read later. Fix this by initializing pasid_mapping_needed to false. Addresses-Coverity: ("Uninitialized scalar variable") Fixes:

[PATCH][next] drm/amdgpu: remove redundant variable r and redundant return statement

2019-10-03 Thread Colin King
From: Colin Ian King There is a return statement that is not reachable and a variable that is not used. Remove them. Addresses-Coverity: ("Structurally dead code") Fixes: de7b45babd9b ("drm/amdgpu: cleanup creating BOs at fixed location (v2)") Signed-off-by: Colin Ian King ---

[PATCH][drm-next] drm/amd/display: fix spelling mistake AUTHENICATED -> AUTHENTICATED

2019-10-03 Thread Colin King
From: Colin Ian King There is a spelling mistake in the macros H1_A45_AUTHENICATED and D1_A4_AUTHENICATED, fix these by adding the missing T. Signed-off-by: Colin Ian King --- drivers/gpu/drm/amd/display/modules/hdcp/hdcp.h | 4 ++-- .../drm/amd/display/modules/hdcp/hdcp1_execution.c

[PATCH] drm/amd/display: rename variable eanble -> enable

2019-09-13 Thread Colin King
From: Colin Ian King There is a spelling mistake in the variable name eanble, rename it to enable. Signed-off-by: Colin Ian King --- drivers/gpu/drm/amd/display/dc/dce/dce_mem_input.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git

[PATCH][drm-next] drm/amdgpu: fix spelling mistake "jumpimng" -> "jumping"

2019-08-28 Thread Colin King
From: Colin Ian King There is a spelling mistake in a DRM_DEBUG_DRIVER debug message. Fix it. Signed-off-by: Colin Ian King --- drivers/gpu/drm/amd/amdgpu/amdgpu_ras_eeprom.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ras_eeprom.c

[PATCH] drm/amdgpu/powerplay: remove redundant assignment to variable baco_state

2019-08-22 Thread Colin King
From: Colin Ian King Variable baco_state is initialized to a value that is never read and it is re-assigned later. The initialization is redundant and can be removed. Addresses-Coverity: ("Unused Value") Signed-off-by: Colin Ian King --- drivers/gpu/drm/amd/powerplay/smu_v11_0.c | 2 +- 1

[PATCH][drm-next] drm/amd/display: fix a potential null pointer dereference

2019-08-16 Thread Colin King
From: Colin Ian King Currently the pointer init_data is dereferenced on the assignment of fw_info before init_data is sanity checked to see if it is null. Fix te potential null pointer dereference on init_data by only performing dereference after it is null checked. Addresses-Coverity:

[PATCH] drm/amdgpu/powerplay: fix spelling mistake "unsuported" -> "unsupported"

2019-08-13 Thread Colin King
From: Colin Ian King There is a spelling mistake in a pr_err error message. Fix it. Also add a space after a comma to clean up a checkpatch warning. Signed-off-by: Colin Ian King --- drivers/gpu/drm/amd/powerplay/smu_v11_0.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git

[PATCH][drm-next] drm/amd/powerplay: remove redundant duplicated return check

2019-08-05 Thread Colin King
From: Colin Ian King The check on ret is duplicated in two places, it is redundant code. Remove it. Addresses-Coverity: ("Logically dead code") Fixes: b94afb61cdae ("drm/amd/powerplay: honor hw limit on fetching metrics data for navi10") Signed-off-by: Colin Ian King ---

[PATCH][drm-next] drm/amd/powerplay: fix off-by-one upper bounds limit checks

2019-08-01 Thread Colin King
From: Colin Ian King There are two occurrances of off-by-one upper bound checking of indexes causing potential out-of-bounds array reads. Fix these. Addresses-Coverity: ("Out-of-bounds read") Fixes: cb33363d0e85 ("drm/amd/powerplay: add smu feature name support") Fixes: 6b294793e384

[PATCH][drm-next] drm/amdgpu: fix unsigned variable instance compared to less than zero

2019-08-01 Thread Colin King
From: Colin Ian King Currenly the error check on variable instance is always false because it is a uint32_t type and this is never less than zero. Fix this by making it an int type. Addresses-Coverity: ("Unsigned compared against 0") Fixes: 7d0e6329dfdc ("drm/amdgpu: update more sdma instances

  1   2   >