From: Tom Rix
Clang static analysis reports this error
amdgpu_debugfs.c:1690:9: warning: 1st function call
argument is an uninitialized value
tmp = krealloc_array(tmp, i + 1,
^~~
realloc uses tmp, so tmp can not be garbage.
And the return needs to be checked.
From: Tom Rix
Clang static analysis reports this error
amdgpu_debugfs.c:1690:9: warning: 1st function call
argument is an uninitialized value
tmp = krealloc_array(tmp, i + 1,
^~~
realloc will free tmp, so tmp can not be garbage.
And the return needs to be chec
From: Tom Rix
On mips64 allyesconfig, there is this build break
amdgpu_discovery.c:671:35: error: format '%ld' expects
argument of type 'long int', but argument 4 has
type 'size_t' {aka 'unsigned int'}
DRM_DEBUG("match:%d @ ip_offset:%ld", ii, ip_offset);
For size_t, use %zu.
Fixes: a6c40
From: Tom Rix
Clang static analysis reports this problem
kfd_chardev.c:2327:2: warning: 1st function call argument
is an uninitialized value
kvfree(bo_privs);
^~~~
If the copy_from_users(bo_buckets, ...) fails, there is a jump to
the generic error handler at exit:. The freeing
From: Tom Rix
Clang build fails with
kfd_packet_manager_v9.c:267:3: error: implicit conversion
from enumeration type 'enum mes_map_queues_extended_engine_sel_enum'
to different enumeration type
'enum mes_unmap_queues_extended_engine_sel_enum'
extended_engine_sel__mes_map_queues__sdma0_to
From: Tom Rix
Clang build fails with
amdgpu_ras.c:2416:7: error: variable 'ras_obj' is used uninitialized
whenever 'if' condition is true
if (adev->in_suspend || amdgpu_in_reset(adev)) {
^
amdgpu_ras.c:2453:6: note: uninitialized use occurs here
if
From: Tom Rix
Clang static analysis reports this problem
amdgpu_ctx.c:616:26: warning: Assigned value is garbage
or undefined
args->out.pstate.flags = stable_pstate;
^ ~
amdgpu_ctx_stable_pstate can fail without setting
stable_pstate. So check.
Fixes: 8c
From: Tom Rix
Clang static analysis reports this problem
kfd_chardev.c:2594:16: warning: The expression is an uninitialized value.
The computed value will also be garbage
while (ret && i--) {
^~~
i is a loop variable and this block unwinds a problem in the loop.
W
From: Tom Rix
clang static analysis reports this problem
kfd_chardev.c:2092:2: warning: 1st function call argument
is an uninitialized value
kvfree(bo_privs);
^~~~
When bo_buckets alloc fails, it jumps to an error handler
that frees the yet to be allocated bo_privs.
From: Tom Rix
clang static analysis reports this error
amdgpu_smu.c:2289:9: warning: Called function pointer
is null (null dereference)
return smu->ppt_funcs->emit_clk_levels(
^~~~
There is a logic error in the earlier check of
emit_clk_levels
From: Tom Rix
clang build fails with
amdgpu_virt.c:878:51: error: variable 'reg_access_ctrl' is
uninitialized when used here
... + 4 * reg_access_ctrl->scratch_reg0;
^~~
The reg_access_ctrl ptr is never initialized, so
initialize once we know it is supported.
Fixes:
From: Tom Rix
clang static analysis reports this represenative problem
amdgpu_smu.c:144:18: warning: The left operand of '*' is a garbage value
return clk_freq * 100;
^
If there is no get_dpm_ultimate_freq function,
smu_get_dpm_freq_range returns success without s
From: Tom Rix
clang static analysis reports this represenative problem
amdgpu_smu.c:144:18: warning: The left operand of '*' is a garbage value
return clk_freq * 100;
^
If there is no get_dpm_ultimate_freq function,
smu_get_dpm_freq_range returns success without s
From: Tom Rix
The enum MIGRATION_COPY_DIR type has 2 values. So
the else-if can be converted to an else.
Signed-off-by: Tom Rix
---
drivers/gpu/drm/amd/amdkfd/kfd_migrate.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_migrate.c
b/driver
From: Tom Rix
When CONFIG_HSA_AMD=n this there is this error
amdgpu_amdkfd.c:75:56: error: incompatible type for
argument 2 of ‘kgd2kfd_probe’
75 | adev->kfd.dev = kgd2kfd_probe((struct kgd_dev *)adev, vf);
amdgpu_amdkfd.h:349:17: note: declared here
349 | struct kfd_dev *kgd2kfd_probe(s
From: Tom Rix
Static analysis reports this problem
amdgpu_ras.c:2324:2: warning: 2nd function call argument is an
uninitialized value
atomic_set(&con->ras_ce_count, ce_count);
^~~~
ce_count is normally set by the earlier call to
amdgpu_ras_qu
From: Tom Rix
Static analysis reports this problem
amdgpu_pm.c:478:16: warning: The right operand of '<' is a garbage value
for (i = 0; i < data.nums; i++) {
^ ~
In some cases data is not set. Initialize to 0 and flag not setting
data as an error with the existing che
From: Tom Rix
See Documentation/core-api/printk-formats.rst.
h should no longer be used in the format specifier for printk.
Signed-off-by: Tom Rix
---
drivers/gpu/drm/radeon/radeon_uvd.c | 2 +-
drivers/gpu/drm/radeon/radeon_vce.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff
From: Tom Rix
See Documentation/core-api/printk-formats.rst.
h should no longer be used in the format specifier for printk.
Signed-off-by: Tom Rix
---
drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c | 4 ++--
drivers/gpu/drm/amd/amdgpu/amdgpu_vce.c | 2 +-
drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c | 4 +
From: Tom Rix
The macro use will already have a semicolon.
Signed-off-by: Tom Rix
---
drivers/gpu/drm/amd/amdgpu/amdgpu.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu.h
b/drivers/gpu/drm/amd/amdgpu/amdgpu.h
index f9c81bc21ba4..301e93c9e
A difficult part of automating commits is composing the subsystem
preamble in the commit log. For the ongoing effort of a fixer producing
one or two fixes a release the use of 'treewide:' does not seem appropriate.
It would be better if the normal prefix was used. Unfortunately normal is
not con
From: Tom Rix
A semicolon is not needed after a switch statement.
Signed-off-by: Tom Rix
---
drivers/gpu/drm/amd/display/dc/dce112/dce112_resource.c | 2 +-
drivers/gpu/drm/amd/display/modules/hdcp/hdcp_log.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/gp
From: Tom Rix
A semicolon is not needed after a switch statement.
Signed-off-by: Tom Rix
---
drivers/gpu/drm/amd/amdgpu/amdgpu_pmu.c | 2 +-
drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_pmu.c
b
This rfc will describe
An upcoming treewide cleanup.
How clang tooling was used to programatically do the clean up.
Solicit opinions on how to generally use clang tooling.
The clang warning -Wextra-semi-stmt produces about 10k warnings.
Reviewing these, a subset of semicolon after a switch looks s
From: Tom Rix
A break is not needed if it is preceded by a return or break
Signed-off-by: Tom Rix
---
drivers/gpu/drm/amd/display/dc/dce/dce_transform.c | 1 -
drivers/gpu/drm/amd/display/dc/dce100/dce100_resource.c | 7 ---
drivers/gpu/drm/amd/display/dc/dce110/dce110_resource.c | 7
From: Tom Rix
This is a upcoming change to clean up a new warning treewide.
I am wondering if the change could be one mega patch (see below) or
normal patch per file about 100 patches or somewhere half way by collecting
early acks.
clang has a number of useful, new warnings see
https://clang.llv
From: Tom Rix
Representative checkpatch.pl warning
WARNING: adding a line without newline at end of file
30: FILE: drivers/gpu/drm/amd/pm/swsmu/smu11/vangogh_ppt.h:30:
+#endif
Signed-off-by: Tom Rix
---
drivers/gpu/drm/amd/include/asic_reg/gc/gc_9_4_1_sh_mask.h | 2 +-
drivers/gpu/drm/amd/pm
From: Tom Rix
clang static analysis flags this error
drivers/gpu/drm/radeon/ci_dpm.c:5652:9: warning: Use of memory after it is
freed [unix.Malloc]
kfree(rdev->pm.dpm.ps[i].ps_priv);
^~
drivers/gpu/drm/radeon/ci_dpm.c:5654:2: warning
28 matches
Mail list logo