Skip to content

Commit

Permalink
ethtool: netlink: Slightly simplify 'ethnl_features_to_bitmap()'
Browse files Browse the repository at this point in the history
The 'dest' bitmap is fully initialized by the 'for' loop, so there is no
need to explicitly reset it.

This also makes this function in line with 'ethnl_features_to_bitmap32()'
which does not clear the destination before writing it.

Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Link: https://lore.kernel.org/r/17fca158231c6f03689bd891254f0dd1f4e84cb8.1638091829.git.christophe.jaillet@wanadoo.fr
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
  • Loading branch information
Christophe JAILLET authored and Jakub Kicinski committed Nov 30, 2021
1 parent a21ee5b commit 72a2ff5
Showing 1 changed file with 0 additions and 1 deletion.
1 change: 0 additions & 1 deletion net/ethtool/features.c
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,6 @@ static void ethnl_features_to_bitmap(unsigned long *dest, netdev_features_t val)
const unsigned int words = BITS_TO_LONGS(NETDEV_FEATURE_COUNT);
unsigned int i;

bitmap_zero(dest, NETDEV_FEATURE_COUNT);
for (i = 0; i < words; i++)
dest[i] = (unsigned long)(val >> (i * BITS_PER_LONG));
}
Expand Down

0 comments on commit 72a2ff5

Please sign in to comment.