[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20211216091713.449841-1-deng.changcheng@zte.com.cn>
Date: Thu, 16 Dec 2021 09:17:13 +0000
From: cgel.zte@...il.com
To: ajay.kathat@...rochip.com
Cc: claudiu.beznea@...rochip.com, kvalo@...nel.org,
davem@...emloft.net, kuba@...nel.org,
linux-wireless@...r.kernel.org, netdev@...r.kernel.org,
linux-kernel@...r.kernel.org,
Changcheng Deng <deng.changcheng@....com.cn>,
Zeal Robot <zealci@....com.cn>
Subject: [PATCH] wilc1000: use min() to make code cleaner
From: Changcheng Deng <deng.changcheng@....com.cn>
Use min() in order to make code cleaner.
Reported-by: Zeal Robot <zealci@....com.cn>
Signed-off-by: Changcheng Deng <deng.changcheng@....com.cn>
---
drivers/net/wireless/microchip/wilc1000/spi.c | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)
diff --git a/drivers/net/wireless/microchip/wilc1000/spi.c b/drivers/net/wireless/microchip/wilc1000/spi.c
index 6e7fd18c14e7..629ba5d7a7df 100644
--- a/drivers/net/wireless/microchip/wilc1000/spi.c
+++ b/drivers/net/wireless/microchip/wilc1000/spi.c
@@ -675,10 +675,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(sz, DATA_PKT_SZ);
/*
* Data Response header
--
2.25.1
Powered by blists - more mailing lists