Smatch reports for zynqmp video driver
Michal Simek
michal.simek at amd.com
Wed Oct 1 16:51:13 CEST 2025
Hi,
On 10/1/25 16:03, Andrew Goodbody wrote:
> Smatch reports the following two issues
>
> drivers/video/zynqmp/zynqmp_dpsub.c:271 config_gfx_pipeline() error:
> uninitialized symbol 'offset_matrix'.
> drivers/video/zynqmp/zynqmp_dpsub.c:277 config_gfx_pipeline() error:
> uninitialized symbol 'csc_matrix'.
>
> Looking at the code, offset_matrix and csc_matrix are only initialised if video-
> >is_rgb is true. It looks almost as if the code for video->is_rgb being false
> was never written. So I am not sure of the correct fix for this.
Thanks for report. This should fix it.
Do you want me to send a patch for it?
Thanks,
Michal
diff --git a/drivers/video/zynqmp/zynqmp_dpsub.c
b/drivers/video/zynqmp/zynqmp_dpsub.c
index 52af23c3c835..442036e93f72 100644
--- a/drivers/video/zynqmp/zynqmp_dpsub.c
+++ b/drivers/video/zynqmp/zynqmp_dpsub.c
@@ -262,10 +262,12 @@ static void config_gfx_pipeline(struct udevice *dev)
video->sampling_en;
writel(regval, dp_sub->base_addr + AVBUF_V_BLEND_LAYER1_CONTROL);
- if (video->is_rgb) {
- csc_matrix = rgb_coeffs;
- offset_matrix = rgb_offset;
- }
+ if (!video->is_rgb)
+ return
+
+ csc_matrix = rgb_coeffs;
+ offset_matrix = rgb_offset;
+
/* Program Colorspace conversion coefficients */
for (index = 9; index < 12; index++) {
writel(offset_matrix[index - 9], dp_sub->base_addr +
More information about the U-Boot
mailing list