[bug report] drm/sun4i: Add HDMI support
Dan Carpenter
dan.carpenter at oracle.com
Wed Oct 17 10:43:11 UTC 2018
Hello Maxime Ripard,
The patch 9c5681011a0c: "drm/sun4i: Add HDMI support" from May 27,
2017, leads to the following static checker warning:
drivers/gpu/drm/sun4i/sun4i_hdmi_tmds_clk.c:62 sun4i_tmds_calc_divider()
error: uninitialized symbol 'is_double'.
drivers/gpu/drm/sun4i/sun4i_hdmi_tmds_clk.c
30 static unsigned long sun4i_tmds_calc_divider(unsigned long rate,
31 unsigned long parent_rate,
32 u8 div_offset,
33 u8 *div,
34 bool *half)
35 {
36 unsigned long best_rate = 0;
37 u8 best_m = 0, m;
38 bool is_double;
^^^^^^^^^^^^^^^
39
40 for (m = div_offset ?: 1; m < (16 + div_offset); m++) {
41 u8 d;
42
43 for (d = 1; d < 3; d++) {
44 unsigned long tmp_rate;
45
46 tmp_rate = parent_rate / m / d;
47
48 if (tmp_rate > rate)
49 continue;
50
51 if (!best_rate ||
52 (rate - tmp_rate) < (rate - best_rate)) {
53 best_rate = tmp_rate;
54 best_m = m;
55 is_double = d;
^^^^^^^^^^^^^^
The "is_double" variable is a bool and d is 1-2 so this would be more
readable as "is_double = true;".
56 }
57 }
58 }
59
60 if (div && half) {
61 *div = best_m;
62 *half = is_double;
^^^^^^^^^^^^^^^^^^
This is either true or uninitialized.
63 }
64
65 return best_rate;
66 }
regards,
dan carpenter
More information about the dri-devel
mailing list