i2c: designware: Use better constants from units.h
Subsystems (3)
Andy Shevchenko
reviewerPATCH 1/1 i2c: designware: Use better constants from units.h
When we use constants in a time or frequency related contexts, it's better to utilise the respective definitions that have encoded units in them. This will make code better to read and understand.
--- drivers/i2c/busses/i2c-designware-platdrv.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/i2c/busses/i2c-designware-platdrv.c +1 -1
@@ -34,7 +34,7 @@static u32 i2c_dw_get_clk_rate_khz (struct dw_i2c_dev *dev) { -return clk_get_rate (dev->clk) /KILO ; +return clk_get_rate (dev->clk) /HZ_PER_KHZ ; }#ifdef CONFIG_OF
Signature · 1 line
2.47.2
Quoted 15 lines · Andy Shevchenko
When we use constants in a time or frequency related contexts, it's better to utilise the respective definitions that have encoded units in them. This will make code better to read and understand.
Signed-off-by Andy Shevchenko <[email protected]>--- drivers/i2c/busses/i2c-designware-platdrv.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/i2c/busses/i2c-designware-platdrv.c +0
-0
drivers/i2c/busses/i2c-designware-platdrv.c line 40
Quoted 8 lines
drivers/i2c/busses/i2c-designware-platdrv.c +1
-1@@ -34,7 +34,7 @@static u32 i2c_dw_get_clk_rate_khz (struct dw_i2c_dev *dev) { -return clk_get_rate (dev->clk) /KILO ; +return clk_get_rate (dev->clk) /HZ_PER_KHZ ; }#ifdef CONFIG_OF
Quoted 10 lines · Andy Shevchenko
When we use constants in a time or frequency related contexts, it's better to utilise the respective definitions that have encoded units in them. This will make code better to read and understand.
Signed-off-by Andy Shevchenko <[email protected]>--- drivers/i2c/busses/i2c-designware-platdrv.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Hi Andy,
Quoted 6 lines · Andy Shevchenko
When we use constants in a time or frequency related contexts, it's better to utilise the respective definitions that have encoded units in them. This will make code better to read and understand.
Signed-off-by Andy Shevchenko <[email protected]>
merged to i2c/i2c-host.
Thanks,
Andi