[PATCH v4] i2c: busses: Use min() to improve code

Andi Shyti andi.shyti at kernel.org
Sat Jul 12 01:25:13 PDT 2025


Hi,

On Fri, Jul 11, 2025 at 09:57:24PM +0300, Andy Shevchenko wrote:
> On Wed, Jul 09, 2025 at 12:23:46PM +0800, Qianfeng Rong wrote:
> > 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.
> 
> ...
> 
> >  #include <linux/of.h>
> >  #include <linux/pinctrl/consumer.h>
> >  #include <linux/platform_device.h>
> > +#include <linux/minmax.h>
> 
> Do not blindly add a new inclusion to the end of the list. The list as you may
> notice even on this small context suggests that it's ordered. Please, keep
> things in order.
> 
> Andi, if you don't mind, please fix this.

Yes, I actually had this fixed but I had forgotten to push. It's
updated now.

Andi



More information about the linux-arm-kernel mailing list