MLK-18978: drm: imx: dcss: fix warning message
authorLaurentiu Palcu <laurentiu.palcu@nxp.com>
Thu, 19 Jul 2018 08:27:12 +0000 (11:27 +0300)
committerLeonard Crestez <leonard.crestez@nxp.com>
Wed, 17 Apr 2019 23:51:34 +0000 (02:51 +0300)
commitf1a92c4b417abc1aa7d6babd6b6abbbfb84589b6
treede44ba202e5ba3e944d7c9ef8c92570c6e969ecf
parent4547091676ae088fe81fb475766b36090e0a3252
MLK-18978: drm: imx: dcss: fix warning message

This patch fixes a warning message that's seen during 4.14 compilation.

  CC      drivers/gpu/drm/imx/dcss/dcss-plane.o
drivers/gpu/drm/imx/dcss/dcss-plane.c: In function ‘dcss_plane_atomic_set_base’:
drivers/gpu/drm/imx/dcss/dcss-plane.c:347:4: warning: ‘caddr’ may be used uninitialized in this function [-Wmaybe-uninitialized]
    dcss_dec400d_addr_set(dcss_plane->dcss, p1_ba, caddr);
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

The warning appeared because of a logic error in code that was
introduced by the following commit:

commit a46e1cd7df28 ("MGS-3560 [#imx-913] Enable DRM compression for
mscale board")

The above commit moved a piece of code, that was located under
switch-case branch, under a do-while() loop and converted all the
returns to breaks. However, a break makes the code exit the while loop
and will continue executing the code under the case branch. Hence, caddr
may be used whithout being initialized.

Signed-off-by: Laurentiu Palcu <laurentiu.palcu@nxp.com>
CC: Yong Gan <yong.gan@nxp.com>
drivers/gpu/drm/imx/dcss/dcss-plane.c