aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorStephen Hemminger <shemminger@linux-foundation.org>2007-11-19 22:23:29 -0500
committerDavid S. Miller <davem@davemloft.net>2008-01-28 17:54:17 -0500
commit0953864160bdd28dfe45fd46fa462b4d2d53cb96 (patch)
treefcc3be7c24858b4606d6eeafee2292a58d84c6a4 /drivers
parent5106930bd6b57402205e3de54dae9476e215b622 (diff)
[NETPOLL]: no need to store local_mac
The local_mac is managed by the network device, no need to keep a spare copy and all the management problems that could cause. Signed-off-by: Stephen Hemminger <shemminger@linux-foundation.org> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/net/netconsole.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/drivers/net/netconsole.c b/drivers/net/netconsole.c
index 5ffbb8891647..31e047dd7bb3 100644
--- a/drivers/net/netconsole.c
+++ b/drivers/net/netconsole.c
@@ -306,9 +306,11 @@ static ssize_t show_remote_ip(struct netconsole_target *nt, char *buf)
306 306
307static ssize_t show_local_mac(struct netconsole_target *nt, char *buf) 307static ssize_t show_local_mac(struct netconsole_target *nt, char *buf)
308{ 308{
309 struct net_device *dev = nt->np.dev;
310
309 DECLARE_MAC_BUF(mac); 311 DECLARE_MAC_BUF(mac);
310 return snprintf(buf, PAGE_SIZE, "%s\n", 312 return snprintf(buf, PAGE_SIZE, "%s\n",
311 print_mac(mac, nt->np.local_mac)); 313 print_mac(mac, dev->dev_addr));
312} 314}
313 315
314static ssize_t show_remote_mac(struct netconsole_target *nt, char *buf) 316static ssize_t show_remote_mac(struct netconsole_target *nt, char *buf)
@@ -667,7 +669,7 @@ static int netconsole_netdev_event(struct notifier_block *this,
667 struct netconsole_target *nt; 669 struct netconsole_target *nt;
668 struct net_device *dev = ptr; 670 struct net_device *dev = ptr;
669 671
670 if (!(event == NETDEV_CHANGEADDR || event == NETDEV_CHANGENAME)) 672 if (!(event == NETDEV_CHANGENAME))
671 goto done; 673 goto done;
672 674
673 spin_lock_irqsave(&target_list_lock, flags); 675 spin_lock_irqsave(&target_list_lock, flags);
@@ -675,10 +677,6 @@ static int netconsole_netdev_event(struct notifier_block *this,
675 netconsole_target_get(nt); 677 netconsole_target_get(nt);
676 if (nt->np.dev == dev) { 678 if (nt->np.dev == dev) {
677 switch (event) { 679 switch (event) {
678 case NETDEV_CHANGEADDR:
679 memcpy(nt->np.local_mac, dev->dev_addr, ETH_ALEN);
680 break;
681
682 case NETDEV_CHANGENAME: 680 case NETDEV_CHANGENAME:
683 strlcpy(nt->np.dev_name, dev->name, IFNAMSIZ); 681 strlcpy(nt->np.dev_name, dev->name, IFNAMSIZ);
684 break; 682 break;