Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 277583
b: refs/heads/master
c: 09da71b
h: refs/heads/master
i:
  277581: 8d68cd7
  277579: 935e881
  277575: 1de517a
  277567: 214ca8e
v: v3
  • Loading branch information
Michał Mirosław authored and David S. Miller committed Nov 17, 2011
1 parent 3e21962 commit dd17606
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: b721e25383c394f24fa19a66517c5efca382c2e5
refs/heads/master: 09da71b1212f900cca390d2bffc32b2ae4e4eee2
15 changes: 8 additions & 7 deletions trunk/net/core/ethtool.c
Original file line number Diff line number Diff line change
Expand Up @@ -87,13 +87,14 @@ static int ethtool_get_features(struct net_device *dev, void __user *useraddr)
int i;

/* in case feature bits run out again */
BUILD_BUG_ON(ETHTOOL_DEV_FEATURE_WORDS*sizeof(u32) > sizeof(netdev_features_t));
BUILD_BUG_ON(ETHTOOL_DEV_FEATURE_WORDS * sizeof(u32) > sizeof(netdev_features_t));

for (i = 0; i < ETHTOOL_DEV_FEATURE_WORDS; ++i) {
features[i].available = (u32)(dev->hw_features >> (32*i));
features[i].requested = (u32)(dev->wanted_features >> (32*i));
features[i].active = (u32)(dev->features >> (32*i));
features[i].never_changed = (u32)(NETIF_F_NEVER_CHANGE >> (32*i));
features[i].available = (u32)(dev->hw_features >> (32 * i));
features[i].requested = (u32)(dev->wanted_features >> (32 * i));
features[i].active = (u32)(dev->features >> (32 * i));
features[i].never_changed =
(u32)(NETIF_F_NEVER_CHANGE >> (32 * i));
}

sizeaddr = useraddr + offsetof(struct ethtool_gfeatures, size);
Expand Down Expand Up @@ -130,8 +131,8 @@ static int ethtool_set_features(struct net_device *dev, void __user *useraddr)
return -EFAULT;

for (i = 0; i < ETHTOOL_DEV_FEATURE_WORDS; ++i) {
valid |= (netdev_features_t)features[i].valid << (32*i);
wanted |= (netdev_features_t)features[i].requested << (32*i);
valid |= (netdev_features_t)features[i].valid << (32 * i);
wanted |= (netdev_features_t)features[i].requested << (32 * i);
}

if (valid & ~NETIF_F_ETHTOOL_BITS)
Expand Down

0 comments on commit dd17606

Please sign in to comment.