net: ethernet: sun: use min_t() to make code cleaner
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>
This commit is contained in:
parent
40bb09c87f
commit
2c9ec169f7
@ -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,
|
||||
|
Loading…
x
Reference in New Issue
Block a user