Commit 72a2ff56 authored by Christophe JAILLET's avatar Christophe JAILLET Committed by Jakub Kicinski

ethtool: netlink: Slightly simplify 'ethnl_features_to_bitmap()'

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: default avatarChristophe JAILLET <christophe.jaillet@wanadoo.fr>
Link: https://lore.kernel.org/r/17fca158231c6f03689bd891254f0dd1f4e84cb8.1638091829.git.christophe.jaillet@wanadoo.frSigned-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parent a21ee5b2
...@@ -136,7 +136,6 @@ static void ethnl_features_to_bitmap(unsigned long *dest, netdev_features_t val) ...@@ -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); const unsigned int words = BITS_TO_LONGS(NETDEV_FEATURE_COUNT);
unsigned int i; unsigned int i;
bitmap_zero(dest, NETDEV_FEATURE_COUNT);
for (i = 0; i < words; i++) for (i = 0; i < words; i++)
dest[i] = (unsigned long)(val >> (i * BITS_PER_LONG)); dest[i] = (unsigned long)(val >> (i * BITS_PER_LONG));
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment