aboutsummaryrefslogtreecommitdiffstats
path: root/net/tipc
diff options
context:
space:
mode:
authorYing Xue <ying.xue@windriver.com>2012-08-16 08:09:06 -0400
committerDavid S. Miller <davem@davemloft.net>2012-08-20 05:26:30 -0400
commitfa7f86f1bb5d8f08d10442a546252d2670b26f41 (patch)
tree5d778d60fbaeeebdf5c1022e577d62445d1221e2 /net/tipc
parentfff3321d75b1a18231876a1aceb36eacbbf6221e (diff)
tipc: optimize the initialization of network device notifier
Ethernet media initialization is only done when TIPC is started or switched to network mode. So the initialization of the network device notifier structure can be moved out of this function and done statically instead. Signed-off-by: Ying Xue <ying.xue@windriver.com> Signed-off-by: Jon Maloy <jon.maloy@ericsson.com> Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/tipc')
-rw-r--r--net/tipc/eth_media.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/net/tipc/eth_media.c b/net/tipc/eth_media.c
index 90ac9bfa7abb..0f312c261bed 100644
--- a/net/tipc/eth_media.c
+++ b/net/tipc/eth_media.c
@@ -58,7 +58,16 @@ struct eth_bearer {
58static struct tipc_media eth_media_info; 58static struct tipc_media eth_media_info;
59static struct eth_bearer eth_bearers[MAX_ETH_BEARERS]; 59static struct eth_bearer eth_bearers[MAX_ETH_BEARERS];
60static int eth_started; 60static int eth_started;
61static struct notifier_block notifier; 61
62static int recv_notification(struct notifier_block *nb, unsigned long evt,
63 void *dv);
64/*
65 * Network device notifier info
66 */
67static struct notifier_block notifier = {
68 .notifier_call = recv_notification,
69 .priority = 0
70};
62 71
63/** 72/**
64 * eth_media_addr_set - initialize Ethernet media address structure 73 * eth_media_addr_set - initialize Ethernet media address structure
@@ -357,8 +366,6 @@ int tipc_eth_media_start(void)
357 if (res) 366 if (res)
358 return res; 367 return res;
359 368
360 notifier.notifier_call = &recv_notification;
361 notifier.priority = 0;
362 res = register_netdevice_notifier(&notifier); 369 res = register_netdevice_notifier(&notifier);
363 if (!res) 370 if (!res)
364 eth_started = 1; 371 eth_started = 1;