Skip to content

Commit b4eec5c

Browse files
geertubroonie
authored andcommitted
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 <[email protected]> Link: https://patch.msgid.link/30eff1052642a4bcb0f1bc4bed7aae25d355a7dc.1747401908.git.geert+renesas@glider.be Signed-off-by: Mark Brown <[email protected]>
1 parent 3dd5ed1 commit b4eec5c

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

drivers/spi/spi-sh-msiof.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -677,16 +677,16 @@ static int sh_msiof_spi_txrx_once(struct sh_msiof_spi_priv *p,
677677
void (*rx_fifo)(struct sh_msiof_spi_priv *,
678678
void *, int, int),
679679
const void *tx_buf, void *rx_buf,
680-
int words, int bits)
680+
unsigned int words, unsigned int bits)
681681
{
682682
int fifo_shift;
683683
int ret;
684684

685685
/* limit maximum word transfer to rx/tx fifo size */
686686
if (tx_buf)
687-
words = min_t(int, words, p->tx_fifo_size);
687+
words = min(words, p->tx_fifo_size);
688688
if (rx_buf)
689-
words = min_t(int, words, p->rx_fifo_size);
689+
words = min(words, p->rx_fifo_size);
690690

691691
/* the fifo contents need shifting */
692692
fifo_shift = 32 - bits;

0 commit comments

Comments
 (0)