[PATCH v1 1/1] spi: pxa2xx: use min() instead of min_t()

Andy Shevchenko andriy.shevchenko at linux.intel.com
Mon Feb 23 07:23:58 PST 2026


On Mon, Feb 23, 2026 at 03:18:29PM +0000, David Laight wrote:
> On Mon, 23 Feb 2026 15:44:37 +0100
> Andy Shevchenko <andriy.shevchenko at linux.intel.com> wrote:
> 
> > min_t(int, a, b) casts an 'unsigned long' to 'int'. This might lead
> > to the cases when big number is wrongly chosen. On the other hand,
> > the SPI transfer speed rate is unsigned and driver uses signed type
> > for an unknown reason. Change the type of the SPI transfer speed
> > to be unsigned and convert to use min() instead of min_t().
> 
> I think you should use 'unsigned int' or 'u32' not 'unsigned long'.
> There is no reason for these fields to have different sizes on 32 and 64bit.
> 
> Were spi to support 4GHz clocks (fat chance on a pcb track) you'd
> need to use u64.

Fair enough. I will correct in v2.
Thanks for review.

-- 
With Best Regards,
Andy Shevchenko





More information about the linux-arm-kernel mailing list