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

Andy Shevchenko andriy.shevchenko at intel.com
Fri Jul 11 11:57:24 PDT 2025


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.

-- 
With Best Regards,
Andy Shevchenko





More information about the linux-arm-kernel mailing list