diff options
author | Maciej Fijalkowski <[email protected]> | 2022-07-07 12:16:50 +0200 |
---|---|---|
committer | Tony Nguyen <[email protected]> | 2022-07-28 11:44:40 -0700 |
commit | c67672fa26959b5b636c149634e69491a4d64206 (patch) | |
tree | a4f531c342d09e266158fcb9f913e4a88ff221a4 /tools/perf/scripts/python/check-perf-trace.py | |
parent | a419526de6079e4b8a001bcbb8ac7370ba581963 (diff) |
ice: compress branches in ice_set_features()
Instead of rather verbose comparison of current netdev->features bits vs
the incoming ones from user, let us compress them by a helper features
set that will be the result of netdev->features XOR features. This way,
current, extensive branches:
if (features & NETIF_F_BIT && !(netdev->features & NETIF_F_BIT))
set_feature(true);
else if (!(features & NETIF_F_BIT) && netdev->features & NETIF_F_BIT)
set_feature(false);
can become:
netdev_features_t changed = netdev->features ^ features;
if (changed & NETIF_F_BIT)
set_feature(!!(features & NETIF_F_BIT));
This is nothing new as currently several other drivers use this
approach, which I find much more convenient.
Acked-by: John Fastabend <[email protected]>
Signed-off-by: Maciej Fijalkowski <[email protected]>
Tested-by: George Kuruvinakunnel <[email protected]>
Signed-off-by: Tony Nguyen <[email protected]>
Diffstat (limited to 'tools/perf/scripts/python/check-perf-trace.py')
0 files changed, 0 insertions, 0 deletions