MLK-15027: arm: pxp: Fix uninitialized use of variables
authorCristina Ciocan <cristina-mihaela.ciocan@nxp.com>
Thu, 8 Jun 2017 13:47:38 +0000 (16:47 +0300)
committerNitin Garg <nitin.garg@nxp.com>
Mon, 19 Mar 2018 20:28:12 +0000 (15:28 -0500)
commit84c9656649b15402cb6523d75ed1204f25db6838
treef882845adfd1e3a17aba0a91d7a2afc6f48c0cd7
parent3260c2119e21900baff5f70e903e8cf28af12068
MLK-15027: arm: pxp: Fix uninitialized use of variables

This patch fixes build warning that 2 variables may be used uninitialized
in the pxp_fetch_config() function in drivers/dma/pxp/pxp_dma_v3.c .

The variables in_fmt and out_fmt are passed as parameters to
pxp_fetch_shift_calc() only if shift_bypass is false. This flag cannot be
false unless changed in a code block that also assigns in_fmt and out_fmt.

Since the compiler cannot detect this flow, it shows a warning that in_fmt
and out_fmt are not initialized. Fix this by changing the code flow such
that in_fmt and out_fmt are sent as parameters in the same code block where
they are assigned.

Signed-off-by: Cristina Ciocan <cristina-mihaela.ciocan@nxp.com>
drivers/dma/pxp/pxp_dma_v3.c