diff options
author | Changcheng Deng <deng.changcheng@zte.com.cn> | 2021-12-22 07:08:15 +0000 |
---|---|---|
committer | Kalle Valo <kvalo@kernel.org> | 2022-01-31 17:48:18 +0200 |
commit | 708db268459f239bbd406fbb7349f536b4709f00 (patch) | |
tree | 659789b52e6c15fda59322a4eb1178fa327b6eaa /drivers/net/wireless/microchip/wilc1000/spi.c | |
parent | e109e3617e5d563b431a52e6e2f07f0fc65a93ae (diff) |
wilc1000: use min_t() to make code cleaner
Use min_t() in order to make code cleaner.
Reported-by: Zeal Robot <zealci@zte.com.cn>
Signed-off-by: Changcheng Deng <deng.changcheng@zte.com.cn>
Signed-off-by: Kalle Valo <kvalo@kernel.org>
Link: https://lore.kernel.org/r/20211222070815.483009-1-deng.changcheng@zte.com.cn
Diffstat (limited to 'drivers/net/wireless/microchip/wilc1000/spi.c')
-rw-r--r-- | drivers/net/wireless/microchip/wilc1000/spi.c | 5 |
1 files changed, 1 insertions, 4 deletions
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 |