diff --git a/drivers/spi/spi.c b/drivers/spi/spi.c index 22c71e238fdf0444b90955a2af9370de835a311e..b370d292d19c4d93ef3d98bb5cc6a6ee84ebe05f 100644 --- a/drivers/spi/spi.c +++ b/drivers/spi/spi.c @@ -1551,7 +1551,7 @@ int spi_write_then_read(struct spi_device *spi, * using the pre-allocated buffer or the transfer is too large. */ if ((n_tx + n_rx) > SPI_BUFSIZ || !mutex_trylock(&lock)) { - local_buf = kmalloc(max(SPI_BUFSIZ, n_tx + n_rx), GFP_KERNEL); + local_buf = kmalloc(max((unsigned)SPI_BUFSIZ, n_tx + n_rx), GFP_KERNEL); if (!local_buf) return -ENOMEM; } else {