lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <5a9615d0-86f7-4930-b65d-d7f9196fb281@foss.st.com>
Date: Tue, 13 Jan 2026 16:29:54 +0100
From: Patrice CHOTARD <patrice.chotard@...s.st.com>
To: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>, Andi Shyti
	<andi@...da.it>, Wolfram Sang <wsa+renesas@...g-engineering.com>, "Qianfeng
 Rong" <rongqianfeng@...o.com>, <linux-i2c@...r.kernel.org>,
	<linux-kernel@...r.kernel.org>, <linux-arm-kernel@...ts.infradead.org>,
	<linux-mediatek@...ts.infradead.org>, <linux-rockchip@...ts.infradead.org>
CC: Khalil Blaiech <kblaiech@...dia.com>, Asmaa Mnebhi <asmaa@...dia.com>,
	Andi Shyti <andi.shyti@...nel.org>, Qii Wang <qii.wang@...iatek.com>,
	Matthias Brugger <matthias.bgg@...il.com>, AngeloGioacchino Del Regno
	<angelogioacchino.delregno@...labora.com>, Linus Walleij <linusw@...nel.org>,
	Heiko Stuebner <heiko@...ech.de>, Ard Biesheuvel <ardb@...nel.org>
Subject: Re: [PATCH v1 6/7] i2c: st: Use HZ_PER_GHZ constant instead of plain
 number



On 1/12/26 14:46, Andy Shevchenko wrote:
> Use defined constant to avoid the possible mistakes and to provide
> an additional information on the units.
> 
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
> ---
>  drivers/i2c/busses/i2c-st.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/i2c/busses/i2c-st.c b/drivers/i2c/busses/i2c-st.c
> index 97d70e667227..751ea421caaf 100644
> --- a/drivers/i2c/busses/i2c-st.c
> +++ b/drivers/i2c/busses/i2c-st.c
> @@ -20,6 +20,7 @@
>  #include <linux/of.h>
>  #include <linux/pinctrl/consumer.h>
>  #include <linux/platform_device.h>
> +#include <linux/units.h>
>  
>  /* SSC registers */
>  #define SSC_BRG				0x000
> @@ -285,7 +286,7 @@ static void st_i2c_hw_config(struct st_i2c_dev *i2c_dev)
>  	writel_relaxed(val, i2c_dev->base + SSC_CTL);
>  
>  	rate = clk_get_rate(i2c_dev->clk);
> -	ns_per_clk = 1000000000 / rate;
> +	ns_per_clk = HZ_PER_GHZ / rate;
>  
>  	/* Baudrate */
>  	val = rate / (2 * t->rate);

Reviewed-by: Patrice Chotard <patrice.chotard@...s.st.com>

Thanks
Patrice

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ