From 25f6db4d2d91028a133712045db096b05589f3d6 Mon Sep 17 00:00:00 2001 From: Vinod Polimera Date: Wed, 14 Sep 2022 19:49:08 +0530 Subject: qualcomm/sc7280: initialize tu struct with zeros Coverity is throwing a bunch of "maybe uninitialized" errors for tu struct. Initialize the tu struct with zero. BUG=b:182963902,b:216687885 TEST=Validated on qualcomm sc7280 development board. Monitor name: LQ140M1JW49 Change-Id: Ie249ad4f53abc91376445420712364a28618a15a Signed-off-by: Vinod Polimera Reviewed-on: https://review.coreboot.org/c/coreboot/+/67671 Tested-by: build bot (Jenkins) Reviewed-by: Shelley Chen --- src/soc/qualcomm/sc7280/display/edp_ctrl.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'src/soc/qualcomm/sc7280') diff --git a/src/soc/qualcomm/sc7280/display/edp_ctrl.c b/src/soc/qualcomm/sc7280/display/edp_ctrl.c index 7ec450224f..e9254cc9e8 100644 --- a/src/soc/qualcomm/sc7280/display/edp_ctrl.c +++ b/src/soc/qualcomm/sc7280/display/edp_ctrl.c @@ -1078,7 +1078,7 @@ static void tu_valid_boundary_calc(struct tu_algo_data *tu) static void edp_ctrl_calc_tu(struct edp_ctrl *ctrl, struct edid *edid, struct edp_ctrl_tu *tu_table) { - struct tu_algo_data tu; + struct tu_algo_data tu = {0}; int64_t f = 100000; int64_t LCLK_FAST_SKEW_fp = (6 * f) / 1000; /* 0.0006 */ uint8_t DP_BRUTE_FORCE = 1; @@ -1104,13 +1104,11 @@ static void edp_ctrl_calc_tu(struct edp_ctrl *ctrl, struct edid *edid, tu.extra_buffer_margin = DIV_ROUND_UP(tu.lclk * 4, tu.pclk); tu.ratio_fp = ((int64_t)(tu.pclk_fp * tu.bpp) / 8) / (tu.nlanes * tu.lclk); tu.original_ratio_fp = tu.ratio_fp; - tu.err_fp = 1000 * f; if (((tu.lwidth % tu.nlanes) != 0) && (tu.ratio_fp < f)) { tu.ratio_fp = (tu.ratio_fp * RATIO_SCALE_NUM) / RATIO_SCALE_DEN; tu.ratio_fp = tu.ratio_fp < f ? tu.ratio_fp : f; } - tu.err_fp = 1000 * f; if (tu.ratio_fp > f) tu.ratio_fp = f; -- cgit v1.2.3