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
This commit is contained in:
Changcheng Deng 2021-12-22 07:08:15 +00:00 committed by Kalle Valo
parent e109e3617e
commit 708db26845
1 changed files with 1 additions and 4 deletions

View File

@ -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