06e5af996a11e3b3544c203dbc7f419139110192 Issues on net/core/ethtool.c file . net/core/ethtool.c | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/net/core/ethtool.c b/net/core/ethtool.c index f426c5a..5d7a025 100644 --- a/net/core/ethtool.c +++ b/net/core/ethtool.c @@ -972,7 +972,7 @@ static noinline_for_stack int ethtool_set_rxnfc(struct net_device *dev, if (rc) return rc; - if (cmd == ETHTOOL_SRXCLSRLINS && + if ((cmd == ETHTOOL_SRXCLSRLINS) && copy_to_user(useraddr, &info, info_size)) return -EFAULT; @@ -1120,7 +1120,7 @@ static noinline_for_stack int ethtool_get_rxfh_indir(struct net_device *dev, * device table size it's an error. */ if (user_size < dev_size) - return user_size == 0 ? 0 : -EINVAL; + return (user_size == 0) ? 0 : -EINVAL; indir = kcalloc(dev_size, sizeof(indir[0]), GFP_USER); if (!indir) @@ -1163,7 +1163,7 @@ static noinline_for_stack int ethtool_set_rxfh_indir(struct net_device *dev, sizeof(user_size))) return -EFAULT; - if (user_size != 0 && user_size != dev_size) + if ((user_size != 0) && (user_size != dev_size)) return -EINVAL; indir = kcalloc(dev_size, sizeof(indir[0]), GFP_USER); @@ -1307,11 +1307,11 @@ static noinline_for_stack int ethtool_set_rxfh(struct net_device *dev, * Must request at least one change: indir size, hash key or function. */ if ((rxfh.indir_size && - rxfh.indir_size != ETH_RXFH_INDIR_NO_CHANGE && - rxfh.indir_size != dev_indir_size) || + (rxfh.indir_size != ETH_RXFH_INDIR_NO_CHANGE) && + (rxfh.indir_size != dev_indir_size)) || (rxfh.key_size && (rxfh.key_size != dev_key_size)) || - (rxfh.indir_size == ETH_RXFH_INDIR_NO_CHANGE && - rxfh.key_size == 0 && rxfh.hfunc == ETH_RSS_HASH_NO_CHANGE)) + ((rxfh.indir_size == ETH_RXFH_INDIR_NO_CHANGE) && + (rxfh.key_size == 0) && (rxfh.hfunc == ETH_RSS_HASH_NO_CHANGE))) return -EINVAL; if (rxfh.indir_size != ETH_RXFH_INDIR_NO_CHANGE) @@ -1330,7 +1330,7 @@ static noinline_for_stack int ethtool_set_rxfh(struct net_device *dev, * rxfh.indir_size == ETH_RXFH_INDIR_NO_CHANGE means leave it unchanged. */ if (rxfh.indir_size && - rxfh.indir_size != ETH_RXFH_INDIR_NO_CHANGE) { + (rxfh.indir_size != ETH_RXFH_INDIR_NO_CHANGE)) { indir = (u32 *)rss_config; ret = ethtool_copy_validate_indir(indir, useraddr + rss_cfg_offset, @@ -1592,7 +1592,7 @@ static int ethtool_set_eeprom(struct net_device *dev, void __user *useraddr) return -EINVAL; /* Check for exceeding total eeprom len */ - if (eeprom.offset + eeprom.len > ops->get_eeprom_len(dev)) + if ((eeprom.offset + eeprom.len) > ops->get_eeprom_len(dev)) return -EINVAL; data = kmalloc(PAGE_SIZE, GFP_USER); @@ -1867,9 +1867,9 @@ static int ethtool_phys_id(struct net_device *dev, void __user *useraddr) if (rc) break; schedule_timeout_interruptible(interval); - } while (!signal_pending(current) && --i != 0); + } while (!signal_pending(current) && (--i != 0)); } while (!signal_pending(current) && - (id.data == 0 || --id.data != 0)); + ((id.data == 0) || (--id.data != 0))); } rtnl_lock(); @@ -2122,7 +2122,7 @@ static int ethtool_get_dump_data(struct net_device *dev, * In any case respond to userspace with the actual length of data * it's receiving. */ - WARN_ON(dump.len != len && dump.len != tmp.len); + WARN_ON((dump.len != len) && (dump.len != tmp.len)); dump.len = len; if (copy_to_user(useraddr, &dump, sizeof(dump))) { @@ -2236,8 +2236,8 @@ static int ethtool_tunable_valid(const struct ethtool_tunable *tuna) switch (tuna->id) { case ETHTOOL_RX_COPYBREAK: case ETHTOOL_TX_COPYBREAK: - if (tuna->len != sizeof(u32) || - tuna->type_id != ETHTOOL_TUNABLE_U32) + if ((tuna->len != sizeof(u32)) || + (tuna->type_id != ETHTOOL_TUNABLE_U32)) return -EINVAL; break; default: -- 2.7.4