diff mbox series

[v2] wilc1000: use min_t() to make code cleaner

Message ID 20211222070815.483009-1-deng.changcheng@zte.com.cn (mailing list archive)
State Accepted
Commit 708db268459f239bbd406fbb7349f536b4709f00
Delegated to: Kalle Valo
Headers show
Series [v2] wilc1000: use min_t() to make code cleaner | expand

Commit Message

CGEL Dec. 22, 2021, 7:08 a.m. UTC
From: Changcheng Deng <deng.changcheng@zte.com.cn>

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>
---
 drivers/net/wireless/microchip/wilc1000/spi.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

Comments

Kalle Valo Jan. 31, 2022, 3:48 p.m. UTC | #1
cgel.zte@gmail.com wrote:

> From: Changcheng Deng <deng.changcheng@zte.com.cn>
> 
> 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>

Patch applied to wireless-next.git, thanks.

708db268459f wilc1000: use min_t() to make code cleaner
diff mbox series

Patch

diff --git a/drivers/net/wireless/microchip/wilc1000/spi.c b/drivers/net/wireless/microchip/wilc1000/spi.c
index 5ace9e3a56fc..1057573d086b 100644
--- a/drivers/net/wireless/microchip/wilc1000/spi.c
+++ b/drivers/net/wireless/microchip/wilc1000/spi.c
@@ -674,10 +674,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