From: cgel.zte@gmail.com
To: kvalo@kernel.org
Cc: ajay.kathat@microchip.com, cgel.zte@gmail.com,
claudiu.beznea@microchip.com, davem@davemloft.net,
deng.changcheng@zte.com.cn, kuba@kernel.org,
linux-kernel@vger.kernel.org, linux-wireless@vger.kernel.org,
netdev@vger.kernel.org, zealci@zte.com.cn
Subject: [PATCH v2] wilc1000: use min_t() to make code cleaner
Date: Wed, 22 Dec 2021 07:08:15 +0000 [thread overview]
Message-ID: <20211222070815.483009-1-deng.changcheng@zte.com.cn> (raw)
In-Reply-To: <164011040619.7951.14619016402908057909.kvalo@kernel.org>
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(-)
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
--
2.25.1
next prev parent reply other threads:[~2021-12-22 7:08 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
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 ` cgel.zte [this message]
2022-01-31 15:48 ` [PATCH v2] wilc1000: use min_t() " Kalle Valo
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20211222070815.483009-1-deng.changcheng@zte.com.cn \
--to=cgel.zte@gmail.com \
--cc=ajay.kathat@microchip.com \
--cc=claudiu.beznea@microchip.com \
--cc=davem@davemloft.net \
--cc=deng.changcheng@zte.com.cn \
--cc=kuba@kernel.org \
--cc=kvalo@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-wireless@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=zealci@zte.com.cn \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).