From: Tom Rix
repaper_spi_transfer() allocates a single byte
for the spi header and then another buffer for
the payload. Combine the allocs into a single
buffer with offsets. To simplify the offsets
put the header after the payload.
Signed-off-by: Tom Rix
---
drivers/gpu/drm/tiny/repaper.c |
From: Tom Rix
Clang static analysis reports this issue
intel_dpll.c:472:31: warning: The left operand of '-'
is a garbage value [core.UndefinedBinaryOperatorResult]
this_err = abs(clock.dot - target);
~ ^
In a loop clock.dot is set on successful call to
i9xx_calc_dpl
From: Tom Rix
Clang static analysis reports this issue
anx7625.c:876:13: warning: The left operand of '&' is
a garbage value
if (!(bcap & 0xOA01)) {
^
bcap is only set by a successful call to
anx7625_aux_trans(). So check.
Fixes: cd1637c7e480 ("drm/bridge: anx7625: add HDCP su
From: Tom Rix
For spdx
change tab to space delimiter
Use // for *.c
Replacements
commited to committed
regsiters to registers
initialze to initialize
Signed-off-by: Tom Rix
---
v2: remove multiline comment change
drivers/gpu/drm/panfrost/panfrost_drv.c | 2 +-
drivers/gpu/drm/panfro
From: Tom Rix
make htmldocs fails with
Error: Cannot open file ./drivers/gpu/vga/vgaarb.c
The location of the file changed
drivers/gpu/vga/vgaarb.c -> drivers/pci/vgaarb.c
So update the docs with the new location.
Fixes: d6e1898bfa5b ("PCI/VGA: Move vgaarb to drivers/pci")
Signed-off-by: Tom Ri
From: Tom Rix
For spdx
change tab to space delimiter
Use // for *.c
Replacements
commited to committed, use multiline comment style
regsiters to registers
initialze to initialize
Signed-off-by: Tom Rix
---
drivers/gpu/drm/panfrost/panfrost_drv.c | 2 +-
drivers/gpu/drm/panfrost/panfr
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 static analysis reports this problem
ast_mode.c:1235:3: warning: Use of memory after it is freed
drm_connector_update_edid_property(&ast_connector->base, edid);
^~
The second condition on
if (!flags && ast_con
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
A build error when DRM_NOUVEAU_BACKLIGHT is not defined
disp.c:1665:52: error: 'struct nouveau_connector' has no
member named 'backlight'
Use ifdef's similar to elsewhere in disp.c to conditionally
use the new backlight support.
Move scope of drm to where it is used, inside the
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/i915/gt/intel_sseu.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/i915/gt/intel_sseu.c
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/video/fbdev/omap2/omapfb/dss/dispc-compat.c | 2 +-
drivers/video/fbdev/omap2/omapfb/dss/dsi.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/video/fbdev/omap2
From: Tom Rix
The macro use will already have a semicolon.
Signed-off-by: Tom Rix
---
drivers/gpu/drm/i915/intel_device_info.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/i915/intel_device_info.c
b/drivers/gpu/drm/i915/intel_device_info.c
index e67cec8f
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/mgag200/mgag200_mode.c | 5 -
drivers/gpu/drm/nouveau/nvkm/subdev/bios/pll.c | 1 -
drivers/gpu/drm/nouveau/nvkm/subdev/clk/mcp77.c | 3 ---
drivers/gpu/drm/no
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 reports this problem:
cdv_intel_dp.c:2101:2: warning: Attempt to free released memory
kfree(gma_connector);
^~~~
In cdv_intel_dp_init() when the call to cdv_intel_edp_panel_vdd_off()
fails, the handler calls cdv_intel_dp_destro
From: Tom Rix
clang static analysis flags this problem
hw.c:271:12: warning: The left operand of '>=' is a
garbage value
if (pv.M1 >= pll_lim.vco1.min_m ...
~ ^
This is mostly not a problem because an early check in
nouveau_hw_fix_bad_vpll()
if (nvbios_pll_parse(bios,
From: Tom Rix
clang static analysis flags this error
intel_combo_phy.c:268:7: warning: The left expression of the
compound assignment is an uninitialized value.
The computed value will also be garbage
ret &= check_phy_reg(...
~~~ ^
ret has no initial values,
From: Tom Rix
Reviewing this block of code in cdv_intel_dp_init()
ret = cdv_intel_dp_aux_native_read(gma_encoder, DP_DPCD_REV, ...
cdv_intel_edp_panel_vdd_off(gma_encoder);
if (ret == 0) {
/* if this fails, presume the device is a ghost */
DRM_INFO("failed to retrieve link info,
From: Tom Rix
Clang static analysis reports this representative error
init.c:2501:18: warning: Array access (from variable 'queuedata') results
in a null pointer dereference
templ |= ((queuedata[i] & 0xc0) << 3);
This is the problem block of code
if(ModeNo > 0x13) {
...
From: Tom Rix
clang static analysis reports this repesentative error
pvr2fb.c:1049:2: warning: 1st function call argument
is an uninitialized value [core.CallAndMessage]
if (*cable_arg)
^~~
Problem is that cable_arg depends on the input loop to
set the cable_arg[0]
From: Tom Rix
clang static analysis reports this error
v3d_gem.c:573:4: warning: Attempt to free released
memory [unix.Malloc]
kfree(bin);
^~
Problem is in the block of code
if (ret) {
kfree(bin);
v3d_job_put(&render->base);
From: Tom Rix
clang static analysis flags this error
sil-sii8620.c:184:2: warning: Undefined or garbage value
returned to caller [core.uninitialized.UndefReturn]
return ret;
^~
sii8620_readb calls sii8620_read_buf.
sii8620_read_buf can return without setting its output
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
48 matches
Mail list logo