diff options
author | Fancy Fang <chen.fang@nxp.com> | 2019-04-04 17:19:23 +0800 |
---|---|---|
committer | Fancy Fang <chen.fang@nxp.com> | 2019-04-04 17:50:38 +0800 |
commit | 47ed8c6af4495d271c253215c5aebc3dd6ceb388 (patch) | |
tree | 1c21d8d7ca2987ceb6eaa467814dfa6de18cde32 /drivers/gpu | |
parent | 61869f787fb0ee2f00d0fe9443cb8b487e16e5ec (diff) |
MLK-21383 drm/bridge: sec-dsim: fix maybe-uninitialized build warnings
If enable CONFIG_DYNAMIC_DEBUG, below maybe-uninitialized build
warnings happen:
"
In file included from ./include/linux/printk.h:336:0,
from ./include/linux/kernel.h:14,
from ./include/linux/unaligned/access_ok.h:5,
from ./include/asm-generic/unaligned.h:13,
from ./arch/arm64/include/generated/asm/unaligned.h:1,
from drivers/gpu/drm/bridge/sec-dsim.c:17:
drivers/gpu/drm/bridge/sec-dsim.c: In function ‘sec_mipi_dsim_calc_pmsk’:
./include/linux/dynamic_debug.h:135:3: warning: ‘best_s’ may be used uninitialized in this function [-Wmaybe-uninitialized]
__dynamic_dev_dbg(&descriptor, dev, fmt, \
^
drivers/gpu/drm/bridge/sec-dsim.c:1149:27: note: ‘best_s’ was declared here
uint32_t best_p, best_m, best_s;
^
In file included from ./include/linux/printk.h:336:0,
from ./include/linux/kernel.h:14,
from ./include/linux/unaligned/access_ok.h:5,
from ./include/asm-generic/unaligned.h:13,
from ./arch/arm64/include/generated/asm/unaligned.h:1,
from drivers/gpu/drm/bridge/sec-dsim.c:17:
./include/linux/dynamic_debug.h:135:3: warning: ‘best_m’ may be used uninitialized in this function [-Wmaybe-uninitialized]
__dynamic_dev_dbg(&descriptor, dev, fmt, \
^
drivers/gpu/drm/bridge/sec-dsim.c:1149:19: note: ‘best_m’ was declared here
uint32_t best_p, best_m, best_s;
^
In file included from ./include/linux/printk.h:336:0,
from ./include/linux/kernel.h:14,
from ./include/linux/unaligned/access_ok.h:5,
from ./include/asm-generic/unaligned.h:13,
from ./arch/arm64/include/generated/asm/unaligned.h:1,
from drivers/gpu/drm/bridge/sec-dsim.c:17:
./include/linux/dynamic_debug.h:135:3: warning: ‘best_p’ may be used uninitialized in this function [-Wmaybe-uninitialized]
__dynamic_dev_dbg(&descriptor, dev, fmt, \
^
drivers/gpu/drm/bridge/sec-dsim.c:1149:11: note: ‘best_p’ was declared here
uint32_t best_p, best_m, best_s;
^
"
Although this is a spurious warning according to the code logic, it
is better to give 'best_p', 'best_m' and 'best_s' initial values to
suppress the warnings.
Reported-by: Peter Chen <peter.chen@nxp.com>
Signed-off-by: Fancy Fang <chen.fang@nxp.com>
(cherry picked from commit 753f2cab5a21256d51338caa746909066ba4ea8f)
Diffstat (limited to 'drivers/gpu')
-rw-r--r-- | drivers/gpu/drm/bridge/sec-dsim.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/gpu/drm/bridge/sec-dsim.c b/drivers/gpu/drm/bridge/sec-dsim.c index 48c5ab529c37..2349e55530b2 100644 --- a/drivers/gpu/drm/bridge/sec-dsim.c +++ b/drivers/gpu/drm/bridge/sec-dsim.c @@ -1142,7 +1142,7 @@ static void sec_mipi_dsim_set_standby(struct sec_mipi_dsim *dsim, struct dsim_pll_pms *sec_mipi_dsim_calc_pmsk(struct sec_mipi_dsim *dsim) { uint32_t p, m, s; - uint32_t best_p, best_m, best_s; + uint32_t best_p = 0, best_m = 0, best_s = 0; uint32_t fin, fout; uint32_t s_pow_2, raw_s; uint64_t mfin, pfvco, pfout, psfout; |