From 708db268459f239bbd406fbb7349f536b4709f00 Mon Sep 17 00:00:00 2001 From: Changcheng Deng Date: Wed, 22 Dec 2021 07:08:15 +0000 Subject: wilc1000: use min_t() to make code cleaner Use min_t() in order to make code cleaner. Reported-by: Zeal Robot Signed-off-by: Changcheng Deng Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20211222070815.483009-1-deng.changcheng@zte.com.cn --- drivers/net/wireless/microchip/wilc1000/spi.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'drivers') diff --git a/drivers/net/wireless/microchip/wilc1000/spi.c b/drivers/net/wireless/microchip/wilc1000/spi.c index 2c2ed4b09efd..217477f34c21 100644 --- a/drivers/net/wireless/microchip/wilc1000/spi.c +++ b/drivers/net/wireless/microchip/wilc1000/spi.c @@ -727,10 +727,7 @@ static int wilc_spi_dma_rw(struct wilc *wilc, u8 cmd, u32 adr, u8 *b, u32 sz) int nbytes; u8 rsp; - if (sz <= DATA_PKT_SZ) - nbytes = sz; - else - nbytes = DATA_PKT_SZ; + nbytes = min_t(u32, sz, DATA_PKT_SZ); /* * Data Response header -- cgit v1.2.3