Commit 890d52d3 authored by Eric W. Biederman's avatar Eric W. Biederman Committed by David S. Miller

[ATALK]: In notifier handlers convert the void pointer to a netdevice

This slightly improves code safety and clarity.

Later network namespace patches touch this code so this is a
preliminary cleanup.
Signed-off-by: default avatarEric W. Biederman <ebiederm@xmission.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent ab5f5e8b
...@@ -330,15 +330,16 @@ static void aarp_expire_timeout(unsigned long unused) ...@@ -330,15 +330,16 @@ static void aarp_expire_timeout(unsigned long unused)
static int aarp_device_event(struct notifier_block *this, unsigned long event, static int aarp_device_event(struct notifier_block *this, unsigned long event,
void *ptr) void *ptr)
{ {
struct net_device *dev = ptr;
int ct; int ct;
if (event == NETDEV_DOWN) { if (event == NETDEV_DOWN) {
write_lock_bh(&aarp_lock); write_lock_bh(&aarp_lock);
for (ct = 0; ct < AARP_HASH_SIZE; ct++) { for (ct = 0; ct < AARP_HASH_SIZE; ct++) {
__aarp_expire_device(&resolved[ct], ptr); __aarp_expire_device(&resolved[ct], dev);
__aarp_expire_device(&unresolved[ct], ptr); __aarp_expire_device(&unresolved[ct], dev);
__aarp_expire_device(&proxies[ct], ptr); __aarp_expire_device(&proxies[ct], dev);
} }
write_unlock_bh(&aarp_lock); write_unlock_bh(&aarp_lock);
......
...@@ -647,9 +647,11 @@ static inline void atalk_dev_down(struct net_device *dev) ...@@ -647,9 +647,11 @@ static inline void atalk_dev_down(struct net_device *dev)
static int ddp_device_event(struct notifier_block *this, unsigned long event, static int ddp_device_event(struct notifier_block *this, unsigned long event,
void *ptr) void *ptr)
{ {
struct net_device *dev = ptr;
if (event == NETDEV_DOWN) if (event == NETDEV_DOWN)
/* Discard any use of this */ /* Discard any use of this */
atalk_dev_down(ptr); atalk_dev_down(dev);
return NOTIFY_DONE; return NOTIFY_DONE;
} }
......
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