CC: [email protected] BCC: [email protected] CC: [email protected] TO: Denis Efremov <[email protected]> CC: Julia Lawall <[email protected]> CC: Mark Brown <[email protected]> CC: [email protected] CC: [email protected]
From: kernel test robot <[email protected]> drivers/spi/spi-fsl-lpspi.c:446:12-14: WARNING opportunity for min() Check for opencoded min(), max() implementations. Generated patches sometimes require adding a cast to fix compile warning. Warnings/patches scope intentionally limited to a function body. Generated by: scripts/coccinelle/misc/minmax.cocci CC: Denis Efremov <[email protected]> Reported-by: kernel test robot <[email protected]> Signed-off-by: kernel test robot <[email protected]> --- tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master head: b253435746d9a4a701b5f09211b9c14d3370d0da commit: 5f66f73b9ff4dcabd4e2405ba9c32e80e02f9408 coccinelle: misc: add minmax script :::::: branch date: 14 hours ago :::::: commit date: 12 months ago Please take the patch only if it's a positive warning. Thanks! drivers/spi/spi-fsl-lpspi.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) --- a/drivers/spi/spi-fsl-lpspi.c +++ b/drivers/spi/spi-fsl-lpspi.c @@ -443,10 +443,7 @@ static int fsl_lpspi_setup_transfer(stru fsl_lpspi->tx = fsl_lpspi_buf_tx_u32; } - if (t->len <= fsl_lpspi->txfifosize) - fsl_lpspi->watermark = t->len; - else - fsl_lpspi->watermark = fsl_lpspi->txfifosize; + fsl_lpspi->watermark = min(t->len, fsl_lpspi->txfifosize); if (fsl_lpspi_can_dma(controller, spi, t)) fsl_lpspi->usedma = true; _______________________________________________ kbuild mailing list -- [email protected] To unsubscribe send an email to [email protected]
