Commit 708db268 authored by Changcheng Deng's avatar Changcheng Deng Committed by Kalle Valo

wilc1000: use min_t() to make code cleaner

Use min_t() in order to make code cleaner.
Reported-by: default avatarZeal Robot <zealci@zte.com.cn>
Signed-off-by: default avatarChangcheng Deng <deng.changcheng@zte.com.cn>
Signed-off-by: default avatarKalle Valo <kvalo@kernel.org>
Link: https://lore.kernel.org/r/20211222070815.483009-1-deng.changcheng@zte.com.cn
parent e109e361
......@@ -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
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment