* [bug report] drm/sun4i: Add HDMI support
@ 2018-10-17 10:43 Dan Carpenter
0 siblings, 0 replies; only message in thread
From: Dan Carpenter @ 2018-10-17 10:43 UTC (permalink / raw)
To: maxime.ripard; +Cc: dri-devel
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
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2018-10-17 10:43 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-10-17 10:43 [bug report] drm/sun4i: Add HDMI support Dan Carpenter
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.