Skip to content

Commit

Permalink
netdevice: demote the type of some dev_addr_set() helpers
Browse files Browse the repository at this point in the history
__dev_addr_set() and dev_addr_mod() and pretty low level,
let the arguments be void, there's no chance for confusion
in callers converted to use them. Keep u8 in dev_addr_set()
because some of the callers are converted from a loop
and we want to make sure assignments are not from an array
of a different type.

Signed-off-by: Jakub Kicinski <kuba@kernel.org>
  • Loading branch information
Jakub Kicinski committed Oct 13, 2021
1 parent fe83fe7 commit 40af35f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions include/linux/netdevice.h
Original file line number Diff line number Diff line change
Expand Up @@ -4643,7 +4643,7 @@ void __hw_addr_init(struct netdev_hw_addr_list *list);

/* Functions used for device addresses handling */
static inline void
__dev_addr_set(struct net_device *dev, const u8 *addr, size_t len)
__dev_addr_set(struct net_device *dev, const void *addr, size_t len)
{
memcpy(dev->dev_addr, addr, len);
}
Expand All @@ -4655,7 +4655,7 @@ static inline void dev_addr_set(struct net_device *dev, const u8 *addr)

static inline void
dev_addr_mod(struct net_device *dev, unsigned int offset,
const u8 *addr, size_t len)
const void *addr, size_t len)
{
memcpy(&dev->dev_addr[offset], addr, len);
}
Expand Down

0 comments on commit 40af35f

Please sign in to comment.