net: ethernet: sun: use min_t() to make code cleaner
authorChangcheng Deng <deng.changcheng@zte.com.cn>
Tue, 8 Mar 2022 09:21:06 +0000 (09:21 +0000)
committerDavid 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

index 153edc5..b04a6a7 100644 (file)
@@ -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,