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:
parent
e109e3617e
commit
708db26845
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue