summaryrefslogtreecommitdiff
path: root/drivers/spi/spi-fsl-lpspi.c
diff options
context:
space:
mode:
authorGao Pan <pandy.gao@nxp.com>2016-11-24 19:04:43 +0800
committerMark Brown <broonie@kernel.org>2016-11-25 13:04:42 +0000
commite3a49390ebefec6f7e3d447b5ba3ba253dd51145 (patch)
tree20db3096f3560b816c88d47c220ea608dd48d4f2 /drivers/spi/spi-fsl-lpspi.c
parent3ffa1a5dc696f661754bf145813433fda92371b2 (diff)
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: Gao Pan <pandy.gao@nxp.com> Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'drivers/spi/spi-fsl-lpspi.c')
-rw-r--r--drivers/spi/spi-fsl-lpspi.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/spi/spi-fsl-lpspi.c b/drivers/spi/spi-fsl-lpspi.c
index d7ce32aa083b..18a269d2e2f8 100644
--- a/drivers/spi/spi-fsl-lpspi.c
+++ b/drivers/spi/spi-fsl-lpspi.c
@@ -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.prescale << 27;
- temp |= (fsl_lpspi->config.mode & 0x11) << 30;
+ temp |= (fsl_lpspi->config.mode & 0x3) << 30;
temp |= (fsl_lpspi->config.chip_select & 0x3) << 24;
/*