Skip to content

Commit

Permalink
spi: imx: fix potential shift truncation
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Gao Pan authored and Mark Brown committed Nov 25, 2016
1 parent 3ffa1a5 commit e3a4939
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/spi/spi-fsl-lpspi.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

/*
Expand Down

0 comments on commit e3a4939

Please sign in to comment.