public inbox for linux-i2c@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH v1 1/1] i2c: designware: Use better constants from units.h
@ 2025-04-16 10:17 Andy Shevchenko
  2025-04-16 12:19 ` Mukesh Kumar Savaliya
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Andy Shevchenko @ 2025-04-16 10:17 UTC (permalink / raw)
  To: Andi Shyti, Andy Shevchenko, linux-i2c, linux-kernel
  Cc: Jarkko Nikula, Mika Westerberg, Jan Dabros

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 <andriy.shevchenko@linux.intel.com>
---
 drivers/i2c/busses/i2c-designware-platdrv.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/i2c/busses/i2c-designware-platdrv.c b/drivers/i2c/busses/i2c-designware-platdrv.c
index d6e1ee935399..879719e91df2 100644
--- a/drivers/i2c/busses/i2c-designware-platdrv.c
+++ b/drivers/i2c/busses/i2c-designware-platdrv.c
@@ -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
-- 
2.47.2


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH v1 1/1] i2c: designware: Use better constants from units.h
  2025-04-16 10:17 [PATCH v1 1/1] i2c: designware: Use better constants from units.h Andy Shevchenko
@ 2025-04-16 12:19 ` Mukesh Kumar Savaliya
  2025-04-16 12:23 ` Jarkko Nikula
  2025-04-17 12:01 ` Andi Shyti
  2 siblings, 0 replies; 4+ messages in thread
From: Mukesh Kumar Savaliya @ 2025-04-16 12:19 UTC (permalink / raw)
  To: Andy Shevchenko, Andi Shyti, linux-i2c, linux-kernel
  Cc: Jarkko Nikula, Mika Westerberg, Jan Dabros



On 4/16/2025 3:47 PM, Andy Shevchenko wrote:
> 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 <andriy.shevchenko@linux.intel.com>
> ---
>   drivers/i2c/busses/i2c-designware-platdrv.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/i2c/busses/i2c-designware-platdrv.c b/drivers/i2c/busses/i2c-designware-platdrv.c
> index d6e1ee935399..879719e91df2 100644
> --- a/drivers/i2c/busses/i2c-designware-platdrv.c
> +++ b/drivers/i2c/busses/i2c-designware-platdrv.c
> @@ -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
Acked-by: Mukesh Kumar Savaliya <quic_msavaliy@quicinc.com>


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH v1 1/1] i2c: designware: Use better constants from units.h
  2025-04-16 10:17 [PATCH v1 1/1] i2c: designware: Use better constants from units.h Andy Shevchenko
  2025-04-16 12:19 ` Mukesh Kumar Savaliya
@ 2025-04-16 12:23 ` Jarkko Nikula
  2025-04-17 12:01 ` Andi Shyti
  2 siblings, 0 replies; 4+ messages in thread
From: Jarkko Nikula @ 2025-04-16 12:23 UTC (permalink / raw)
  To: Andy Shevchenko, Andi Shyti, linux-i2c, linux-kernel
  Cc: Mika Westerberg, Jan Dabros

On 4/16/25 1:17 PM, Andy Shevchenko wrote:
> 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 <andriy.shevchenko@linux.intel.com>
> ---
>   drivers/i2c/busses/i2c-designware-platdrv.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
Acked-by: Jarkko Nikula <jarkko.nikula@linux.intel.com>

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH v1 1/1] i2c: designware: Use better constants from units.h
  2025-04-16 10:17 [PATCH v1 1/1] i2c: designware: Use better constants from units.h Andy Shevchenko
  2025-04-16 12:19 ` Mukesh Kumar Savaliya
  2025-04-16 12:23 ` Jarkko Nikula
@ 2025-04-17 12:01 ` Andi Shyti
  2 siblings, 0 replies; 4+ messages in thread
From: Andi Shyti @ 2025-04-17 12:01 UTC (permalink / raw)
  To: Andy Shevchenko
  Cc: linux-i2c, linux-kernel, Jarkko Nikula, Mika Westerberg,
	Jan Dabros

Hi Andy,

On Wed, Apr 16, 2025 at 01:17:02PM +0300, Andy Shevchenko wrote:
> 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 <andriy.shevchenko@linux.intel.com>

merged to i2c/i2c-host.

Thanks,
Andi

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2025-04-17 12:01 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-04-16 10:17 [PATCH v1 1/1] i2c: designware: Use better constants from units.h Andy Shevchenko
2025-04-16 12:19 ` Mukesh Kumar Savaliya
2025-04-16 12:23 ` Jarkko Nikula
2025-04-17 12:01 ` Andi Shyti

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox