Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

spi: sh-msiof: Make words/bits unsigned in sh_msiof_spi_txrx_once()

Make the words and bits parameters of sh_msiof_spi_txrx_once() unsigned,
as that matches what is passed by the caller.

This allows us to replace min_t() by the safer min().

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Link: https://patch.msgid.link/30eff1052642a4bcb0f1bc4bed7aae25d355a7dc.1747401908.git.geert+renesas@glider.be
Signed-off-by: Mark Brown <broonie@kernel.org>

authored by

Geert Uytterhoeven and committed by
Mark Brown
b4eec5cd 3dd5ed19

+3 -3
+3 -3
drivers/spi/spi-sh-msiof.c
··· 677 677 void (*rx_fifo)(struct sh_msiof_spi_priv *, 678 678 void *, int, int), 679 679 const void *tx_buf, void *rx_buf, 680 - int words, int bits) 680 + unsigned int words, unsigned int bits) 681 681 { 682 682 int fifo_shift; 683 683 int ret; 684 684 685 685 /* limit maximum word transfer to rx/tx fifo size */ 686 686 if (tx_buf) 687 - words = min_t(int, words, p->tx_fifo_size); 687 + words = min(words, p->tx_fifo_size); 688 688 if (rx_buf) 689 - words = min_t(int, words, p->rx_fifo_size); 689 + words = min(words, p->rx_fifo_size); 690 690 691 691 /* the fifo contents need shifting */ 692 692 fifo_shift = 32 - bits;