]> git.ipfire.org Git - thirdparty/linux.git/commit
spi: microchip-core: use min() instead of min_t()
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Wed, 26 Nov 2025 07:54:39 +0000 (08:54 +0100)
committerMark Brown <broonie@kernel.org>
Thu, 27 Nov 2025 16:07:43 +0000 (16:07 +0000)
commite29aca7038f3c292c18048922c5f4436a034da99
treef370cd1eb2aa8189976f22a12550055224400c57
parent625f43be3f50966bce1337d744f1bd78dd42ef64
spi: microchip-core: use min() instead of min_t()

min_t(int, a, b) casts an 'unsigned int' to 'int'. This might lead
to the cases when big number is wrongly chosen. On the other hand,
the SPI transfer length is unsigned and driver uses signed type for
an unknown reason. Change the type of the transfer length to be
unsigned and convert 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>
Reviewed-by: Prajna Rajendra Kumar <prajna.rajendrakumar@microchip.com>
Link: https://patch.msgid.link/20251126075558.2035012-2-andriy.shevchenko@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
drivers/spi/spi-microchip-core-spi.c