[PATCH v2] drm/panel: himax-hx8279: Always initialize goa_{even,odd}_valid in hx8279_check_goa_config()
Neil Armstrong
neil.armstrong at linaro.org
Thu Apr 24 08:22:13 UTC 2025
Hi,
On Wed, 23 Apr 2025 10:41:41 -0700, Nathan Chancellor wrote:
> Clang warns (or errors with CONFIG_WERROR=y):
>
> drivers/gpu/drm/panel/panel-himax-hx8279.c:838:6: error: variable 'goa_even_valid' is used uninitialized whenever 'if' condition is false [-Werror,-Wsometimes-uninitialized]
> 838 | if (num_zero == ARRAY_SIZE(desc->goa_even_timing))
> | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> drivers/gpu/drm/panel/panel-himax-hx8279.c:842:23: note: uninitialized use occurs here
> 842 | if (goa_odd_valid != goa_even_valid)
> | ^~~~~~~~~~~~~~
> drivers/gpu/drm/panel/panel-himax-hx8279.c:838:2: note: remove the 'if' if its condition is always true
> 838 | if (num_zero == ARRAY_SIZE(desc->goa_even_timing))
> | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> 839 | goa_even_valid = false;
> drivers/gpu/drm/panel/panel-himax-hx8279.c:818:36: note: initialize the variable 'goa_even_valid' to silence this warning
> 818 | bool goa_odd_valid, goa_even_valid;
> | ^
> | = 0
>
> [...]
Thanks, Applied to https://gitlab.freedesktop.org/drm/misc/kernel.git (drm-misc-next)
[1/1] drm/panel: himax-hx8279: Always initialize goa_{even,odd}_valid in hx8279_check_goa_config()
https://gitlab.freedesktop.org/drm/misc/kernel/-/commit/0228687423587d8ef448fc1d81f96539507aa5bb
--
Neil
More information about the dri-devel
mailing list