]> git.ipfire.org Git - thirdparty/linux.git/commit
spi: pxa2xx: use min() instead of min_t()
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Mon, 23 Feb 2026 15:30:54 +0000 (16:30 +0100)
committerMark Brown <broonie@kernel.org>
Mon, 23 Feb 2026 19:10:26 +0000 (19:10 +0000)
commit507a071d9868cb60e4e76f8a06fc8eb014f59ae4
tree1dc23a47d7d9c2c1c06003c97d1136ebf835e03f
parentfed6e5084894373d76270cad4a32eb6479ad8247
spi: pxa2xx: use min() instead of min_t()

min_t(int, a, b) casts an 'u32' 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().

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Reviewed-by: David Laight <david.laight.linux@gmail.com>
Link: https://patch.msgid.link/20260223153117.2838840-1-andriy.shevchenko@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
drivers/spi/spi-pxa2xx.c