]> git.ipfire.org Git - thirdparty/linux.git/commit
i2c: st: Use min() to improve code
authorQianfeng Rong <rongqianfeng@vivo.com>
Wed, 9 Jul 2025 04:23:46 +0000 (12:23 +0800)
committerAndi Shyti <andi.shyti@linux.intel.com>
Fri, 25 Jul 2025 21:15:23 +0000 (23:15 +0200)
commita9320f3e96adf0398187816b39cfa867340fc40c
tree69855c534674bce8b623daae32c39a1e12cbda3d
parent07e0e8ea6400673fe6eb40d3db2a64f1f2bce4ca
i2c: st: Use min() to improve code

Use min() to reduce the code and improve its readability.

The type of the max parameter in the st_i2c_rd_fill_tx_fifo()
was changed from int to u32, because the max parameter passed
in is always greater than 0.

Signed-off-by: Qianfeng Rong <rongqianfeng@vivo.com>
Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com>
Signed-off-by: Andi Shyti <andi.shyti@kernel.org>
Link: https://lore.kernel.org/r/20250709042347.550993-1-rongqianfeng@vivo.com
drivers/i2c/busses/i2c-st.c