提交 e3a49390 编写于 作者: G Gao Pan 提交者: Mark Brown

spi: imx: fix potential shift truncation

There is a static checker warning in fsl_lpspi_set_cmd().
I intended to write "temp |= (fsl_lpspi->config.mode & 0x3) << 30",
but used "temp |= (fsl_lpspi->config.mode & 0x11) << 30" by mistake.

This patch fixes this potential shift truncation.
Signed-off-by: NGao Pan <pandy.gao@nxp.com>
Signed-off-by: NMark Brown <broonie@kernel.org>
上级 3ffa1a5d
...@@ -215,7 +215,7 @@ static void fsl_lpspi_set_cmd(struct fsl_lpspi_data *fsl_lpspi, ...@@ -215,7 +215,7 @@ static void fsl_lpspi_set_cmd(struct fsl_lpspi_data *fsl_lpspi,
temp |= fsl_lpspi->config.bpw - 1; temp |= fsl_lpspi->config.bpw - 1;
temp |= fsl_lpspi->config.prescale << 27; temp |= fsl_lpspi->config.prescale << 27;
temp |= (fsl_lpspi->config.mode & 0x11) << 30; temp |= (fsl_lpspi->config.mode & 0x3) << 30;
temp |= (fsl_lpspi->config.chip_select & 0x3) << 24; temp |= (fsl_lpspi->config.chip_select & 0x3) << 24;
/* /*
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册