All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] wilc1000: use min() to make code cleaner
@ 2021-12-16  9:17 cgel.zte
  2021-12-21 18:13 ` Kalle Valo
  0 siblings, 1 reply; 4+ messages in thread
From: cgel.zte @ 2021-12-16  9:17 UTC (permalink / raw)
  To: ajay.kathat
  Cc: claudiu.beznea, kvalo, davem, kuba, linux-wireless, netdev,
	linux-kernel, Changcheng Deng, Zeal Robot

From: Changcheng Deng <deng.changcheng@zte.com.cn>

Use min() 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(-)

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


^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2022-01-31 15:48 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-12-16  9:17 [PATCH] wilc1000: use min() to make code cleaner cgel.zte
2021-12-21 18:13 ` Kalle Valo
2021-12-22  7:08   ` [PATCH v2] wilc1000: use min_t() " cgel.zte
2022-01-31 15:48     ` Kalle Valo

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.