From: Junhwan Park Date: Wed, 31 May 2017 02:20:51 +0000 (+0900) Subject: s5j/i2c: tidy up a bit X-Git-Tag: 1.1_Public_Release~188^2~21 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=54d859efe1c31ecd2f31c9d4df30dd81cbf59f97;p=rtos%2Ftinyara.git s5j/i2c: tidy up a bit This commit removes code lines that are not in use, reducing binary footprints as following: text data bss dec hex filename Before 3639 432 16 4087 ff7 s5j_i2c.o After 2819 272 16 3107 c23 s5j_i2c.o Change-Id: Id193c425327dc80e4724773b9e7d51780ca81bc6 Signed-off-by: Junhwan Park --- diff --git a/os/arch/arm/src/s5j/s5j_i2c.c b/os/arch/arm/src/s5j/s5j_i2c.c index 2221fe0..97503f5 100644 --- a/os/arch/arm/src/s5j/s5j_i2c.c +++ b/os/arch/arm/src/s5j/s5j_i2c.c @@ -84,6 +84,7 @@ #define S5J_DEFAULT_I2CSLAVE_ADDR 0x22 #define S5J_DEFAULT_I2C_TIMEOUT 10000 #define S5J_DEFAULT_HS_CLOCK 400000 /* 400Khz */ +#define S5J_DEFAULT_HS_CLOCK 400000 /* 400Khz */ /**************************************************************************** * Private Types @@ -286,7 +287,7 @@ static void hsi2c_calculate_timing(struct s5j_i2c_priv_s *priv, unsigned int nOp tFTL_CYCLE_SCL = (i2c_getreg32(priv, S5J_I2C_CONF) >> 16) & 0x7; - uTemp0 = (priv->clock / nOpClk) - (tFTL_CYCLE_SCL + 3) * 2; + uTemp0 = (float)(priv->clock / nOpClk) - (tFTL_CYCLE_SCL + 3) * 2; for (i = 0; i < 256; i++) { uTemp1 = ((int)uTemp0 + ((tFTL_CYCLE_SCL + 3) % (i + 1)) * 2) / (i + 1);