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: <gheuqazqnfbnxhdjcubhdvnfw6vsjspanllkwblbf63ifll7d3@lchelksxegdw>
Date: Thu, 3 Jul 2025 20:11:47 +0200
From: Andi Shyti <andi.shyti@...nel.org>
To: Qianfeng Rong <rongqianfeng@...o.com>
Cc: Patrice Chotard <patrice.chotard@...s.st.com>, 
	linux-arm-kernel@...ts.infradead.org, linux-i2c@...r.kernel.org, linux-kernel@...r.kernel.org, 
	opensource.kernel@...o.com
Subject: Re: [PATCH] i2c: busses: Use min() to improve code

Hi Qianfeng,

> @@ -422,10 +423,7 @@ static void st_i2c_wr_fill_tx_fifo(struct st_i2c_dev *i2c_dev)
>  	tx_fstat = readl_relaxed(i2c_dev->base + SSC_TX_FSTAT);
>  	tx_fstat &= SSC_TX_FSTAT_STATUS;
>  
> -	if (c->count < (SSC_TXFIFO_SIZE - tx_fstat))
> -		i = c->count;
> -	else
> -		i = SSC_TXFIFO_SIZE - tx_fstat;
> +	i = min(c->count, SSC_TXFIFO_SIZE - tx_fstat);

I think it's safe enough not to need a min_t(int,...

merged to i2c/i2c-host.

Thanks,
Andi

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ