projects
/
platform
/
kernel
/
linux-starfive.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
40bb09c
)
net: ethernet: sun: use min_t() to make code cleaner
author
Changcheng Deng
<deng.changcheng@zte.com.cn>
Tue, 8 Mar 2022 09:21:06 +0000
(09:21 +0000)
committer
David S. Miller
<davem@davemloft.net>
Wed, 9 Mar 2022 14:58:06 +0000
(14:58 +0000)
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>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/sun/cassini.c
patch
|
blob
|
history
diff --git
a/drivers/net/ethernet/sun/cassini.c
b/drivers/net/ethernet/sun/cassini.c
index
153edc5
..
b04a6a7
100644
(file)
--- a/
drivers/net/ethernet/sun/cassini.c
+++ b/
drivers/net/ethernet/sun/cassini.c
@@
-4664,7
+4664,7
@@
static void cas_set_msglevel(struct net_device *dev, u32 value)
static int cas_get_regs_len(struct net_device *dev)
{
struct cas *cp = netdev_priv(dev);
- return
cp->casreg_len < CAS_MAX_REGS ? cp->casreg_len: CAS_MAX_REGS
;
+ return
min_t(int, cp->casreg_len, CAS_MAX_REGS)
;
}
static void cas_get_regs(struct net_device *dev, struct ethtool_regs *regs,