Skip to content
Snippets Groups Projects
Commit 144faeef authored by Clark Wang's avatar Clark Wang Committed by Dong Aisheng
Browse files

MLK-24581-1 lpi2c: fix type char overflow issue when calculating the clock cycle


Claim clkhi and clklo as integer type to avoid possible calculation
errors caused by data overflow.

Reviewed-by: default avatarFugang Duan <fugang.duan@nxp.com>
Signed-off-by: default avatarClark Wang <xiaoning.wang@nxp.com>
parent 6bdc3f38
No related branches found
No related tags found
No related merge requests found
......@@ -213,8 +213,8 @@ static void lpi2c_imx_stop(struct lpi2c_imx_struct *lpi2c_imx)
CLKHI = I2C_CLK_RATIO * clk_cycle */
static int lpi2c_imx_config(struct lpi2c_imx_struct *lpi2c_imx)
{
u8 prescale, filt, sethold, clkhi, clklo, datavd;
unsigned int clk_rate, clk_cycle;
u8 prescale, filt, sethold, datavd;
unsigned int clk_rate, clk_cycle, clkhi, clklo;
enum lpi2c_imx_pincfg pincfg;
unsigned int temp;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment