diff options
author | Adrian Bunk <bunk@stusta.de> | 2006-03-21 01:37:52 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2006-03-21 01:37:52 -0500 |
commit | 988f088a8e9e555dc99ced83690967fad3d905f6 (patch) | |
tree | 7a5831410dd7e50a0b57e123bb2b03e8866ac601 | |
parent | 7c501a5960a1bdf3b9eaef262916dc67107ff2b5 (diff) |
[TIPC]: Cleanups
This patch contains the following possible cleanups:
- make needlessly global code static
- #if 0 the following unused global functions:
- name_table.c: tipc_nametbl_print()
- name_table.c: tipc_nametbl_dump()
- net.c: tipc_net_next_node()
Signed-off-by: Adrian Bunk <bunk@stusta.de>
Signed-off-by: Per Liden <per.liden@ericsson.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | net/tipc/bcast.c | 14 | ||||
-rw-r--r-- | net/tipc/cluster.c | 8 | ||||
-rw-r--r-- | net/tipc/discover.c | 8 | ||||
-rw-r--r-- | net/tipc/name_table.c | 20 | ||||
-rw-r--r-- | net/tipc/net.c | 3 | ||||
-rw-r--r-- | net/tipc/node.c | 2 |
6 files changed, 30 insertions, 25 deletions
diff --git a/net/tipc/bcast.c b/net/tipc/bcast.c index 64cca6479560..3d37fa2c1464 100644 --- a/net/tipc/bcast.c +++ b/net/tipc/bcast.c | |||
@@ -314,7 +314,7 @@ void tipc_bclink_check_gap(struct node *n_ptr, u32 last_sent) | |||
314 | * Only tipc_net_lock set. | 314 | * Only tipc_net_lock set. |
315 | */ | 315 | */ |
316 | 316 | ||
317 | void tipc_bclink_peek_nack(u32 dest, u32 sender_tag, u32 gap_after, u32 gap_to) | 317 | static void tipc_bclink_peek_nack(u32 dest, u32 sender_tag, u32 gap_after, u32 gap_to) |
318 | { | 318 | { |
319 | struct node *n_ptr = tipc_node_find(dest); | 319 | struct node *n_ptr = tipc_node_find(dest); |
320 | u32 my_after, my_to; | 320 | u32 my_after, my_to; |
@@ -425,9 +425,9 @@ void tipc_bclink_recv_pkt(struct sk_buff *buf) | |||
425 | msg_bcgap_to(msg)); | 425 | msg_bcgap_to(msg)); |
426 | } else { | 426 | } else { |
427 | tipc_bclink_peek_nack(msg_destnode(msg), | 427 | tipc_bclink_peek_nack(msg_destnode(msg), |
428 | msg_bcast_tag(msg), | 428 | msg_bcast_tag(msg), |
429 | msg_bcgap_after(msg), | 429 | msg_bcgap_after(msg), |
430 | msg_bcgap_to(msg)); | 430 | msg_bcgap_to(msg)); |
431 | } | 431 | } |
432 | buf_discard(buf); | 432 | buf_discard(buf); |
433 | return; | 433 | return; |
@@ -525,9 +525,9 @@ u32 tipc_bclink_acks_missing(struct node *n_ptr) | |||
525 | * Returns 0 if packet sent successfully, non-zero if not | 525 | * Returns 0 if packet sent successfully, non-zero if not |
526 | */ | 526 | */ |
527 | 527 | ||
528 | int tipc_bcbearer_send(struct sk_buff *buf, | 528 | static int tipc_bcbearer_send(struct sk_buff *buf, |
529 | struct tipc_bearer *unused1, | 529 | struct tipc_bearer *unused1, |
530 | struct tipc_media_addr *unused2) | 530 | struct tipc_media_addr *unused2) |
531 | { | 531 | { |
532 | static int send_count = 0; | 532 | static int send_count = 0; |
533 | 533 | ||
diff --git a/net/tipc/cluster.c b/net/tipc/cluster.c index 9fe45a4837df..b72d09a0e931 100644 --- a/net/tipc/cluster.c +++ b/net/tipc/cluster.c | |||
@@ -44,8 +44,8 @@ | |||
44 | #include "msg.h" | 44 | #include "msg.h" |
45 | #include "bearer.h" | 45 | #include "bearer.h" |
46 | 46 | ||
47 | void tipc_cltr_multicast(struct cluster *c_ptr, struct sk_buff *buf, | 47 | static void tipc_cltr_multicast(struct cluster *c_ptr, struct sk_buff *buf, |
48 | u32 lower, u32 upper); | 48 | u32 lower, u32 upper); |
49 | struct sk_buff *tipc_cltr_prepare_routing_msg(u32 data_size, u32 dest); | 49 | struct sk_buff *tipc_cltr_prepare_routing_msg(u32 data_size, u32 dest); |
50 | 50 | ||
51 | struct node **tipc_local_nodes = NULL; | 51 | struct node **tipc_local_nodes = NULL; |
@@ -229,7 +229,7 @@ struct node *tipc_cltr_select_node(struct cluster *c_ptr, u32 selector) | |||
229 | * Routing table management: See description in node.c | 229 | * Routing table management: See description in node.c |
230 | */ | 230 | */ |
231 | 231 | ||
232 | struct sk_buff *tipc_cltr_prepare_routing_msg(u32 data_size, u32 dest) | 232 | static struct sk_buff *tipc_cltr_prepare_routing_msg(u32 data_size, u32 dest) |
233 | { | 233 | { |
234 | u32 size = INT_H_SIZE + data_size; | 234 | u32 size = INT_H_SIZE + data_size; |
235 | struct sk_buff *buf = buf_acquire(size); | 235 | struct sk_buff *buf = buf_acquire(size); |
@@ -495,7 +495,7 @@ void tipc_cltr_remove_as_router(struct cluster *c_ptr, u32 router) | |||
495 | * tipc_cltr_multicast - multicast message to local nodes | 495 | * tipc_cltr_multicast - multicast message to local nodes |
496 | */ | 496 | */ |
497 | 497 | ||
498 | void tipc_cltr_multicast(struct cluster *c_ptr, struct sk_buff *buf, | 498 | static void tipc_cltr_multicast(struct cluster *c_ptr, struct sk_buff *buf, |
499 | u32 lower, u32 upper) | 499 | u32 lower, u32 upper) |
500 | { | 500 | { |
501 | struct sk_buff *buf_copy; | 501 | struct sk_buff *buf_copy; |
diff --git a/net/tipc/discover.c b/net/tipc/discover.c index 53ba4630c10d..92601385e5f5 100644 --- a/net/tipc/discover.c +++ b/net/tipc/discover.c | |||
@@ -110,10 +110,10 @@ void tipc_disc_link_event(u32 addr, char *name, int up) | |||
110 | * @b_ptr: ptr to bearer issuing message | 110 | * @b_ptr: ptr to bearer issuing message |
111 | */ | 111 | */ |
112 | 112 | ||
113 | struct sk_buff *tipc_disc_init_msg(u32 type, | 113 | static struct sk_buff *tipc_disc_init_msg(u32 type, |
114 | u32 req_links, | 114 | u32 req_links, |
115 | u32 dest_domain, | 115 | u32 dest_domain, |
116 | struct bearer *b_ptr) | 116 | struct bearer *b_ptr) |
117 | { | 117 | { |
118 | struct sk_buff *buf = buf_acquire(DSC_H_SIZE); | 118 | struct sk_buff *buf = buf_acquire(DSC_H_SIZE); |
119 | struct tipc_msg *msg; | 119 | struct tipc_msg *msg; |
diff --git a/net/tipc/name_table.c b/net/tipc/name_table.c index 7be44d4aab75..d129422fc5c2 100644 --- a/net/tipc/name_table.c +++ b/net/tipc/name_table.c | |||
@@ -46,7 +46,7 @@ | |||
46 | #include "cluster.h" | 46 | #include "cluster.h" |
47 | #include "bcast.h" | 47 | #include "bcast.h" |
48 | 48 | ||
49 | int tipc_nametbl_size = 1024; /* must be a power of 2 */ | 49 | static int tipc_nametbl_size = 1024; /* must be a power of 2 */ |
50 | 50 | ||
51 | /** | 51 | /** |
52 | * struct sub_seq - container for all published instances of a name sequence | 52 | * struct sub_seq - container for all published instances of a name sequence |
@@ -142,7 +142,7 @@ static struct publication *publ_create(u32 type, u32 lower, u32 upper, | |||
142 | * tipc_subseq_alloc - allocate a specified number of sub-sequence structures | 142 | * tipc_subseq_alloc - allocate a specified number of sub-sequence structures |
143 | */ | 143 | */ |
144 | 144 | ||
145 | struct sub_seq *tipc_subseq_alloc(u32 cnt) | 145 | static struct sub_seq *tipc_subseq_alloc(u32 cnt) |
146 | { | 146 | { |
147 | u32 sz = cnt * sizeof(struct sub_seq); | 147 | u32 sz = cnt * sizeof(struct sub_seq); |
148 | struct sub_seq *sseq = (struct sub_seq *)kmalloc(sz, GFP_ATOMIC); | 148 | struct sub_seq *sseq = (struct sub_seq *)kmalloc(sz, GFP_ATOMIC); |
@@ -158,7 +158,7 @@ struct sub_seq *tipc_subseq_alloc(u32 cnt) | |||
158 | * Allocates a single sub-sequence structure and sets it to all 0's. | 158 | * Allocates a single sub-sequence structure and sets it to all 0's. |
159 | */ | 159 | */ |
160 | 160 | ||
161 | struct name_seq *tipc_nameseq_create(u32 type, struct hlist_head *seq_head) | 161 | static struct name_seq *tipc_nameseq_create(u32 type, struct hlist_head *seq_head) |
162 | { | 162 | { |
163 | struct name_seq *nseq = | 163 | struct name_seq *nseq = |
164 | (struct name_seq *)kmalloc(sizeof(*nseq), GFP_ATOMIC); | 164 | (struct name_seq *)kmalloc(sizeof(*nseq), GFP_ATOMIC); |
@@ -243,9 +243,9 @@ static u32 nameseq_locate_subseq(struct name_seq *nseq, u32 instance) | |||
243 | * tipc_nameseq_insert_publ - | 243 | * tipc_nameseq_insert_publ - |
244 | */ | 244 | */ |
245 | 245 | ||
246 | struct publication *tipc_nameseq_insert_publ(struct name_seq *nseq, | 246 | static struct publication *tipc_nameseq_insert_publ(struct name_seq *nseq, |
247 | u32 type, u32 lower, u32 upper, | 247 | u32 type, u32 lower, u32 upper, |
248 | u32 scope, u32 node, u32 port, u32 key) | 248 | u32 scope, u32 node, u32 port, u32 key) |
249 | { | 249 | { |
250 | struct subscription *s; | 250 | struct subscription *s; |
251 | struct subscription *st; | 251 | struct subscription *st; |
@@ -369,8 +369,8 @@ struct publication *tipc_nameseq_insert_publ(struct name_seq *nseq, | |||
369 | * tipc_nameseq_remove_publ - | 369 | * tipc_nameseq_remove_publ - |
370 | */ | 370 | */ |
371 | 371 | ||
372 | struct publication *tipc_nameseq_remove_publ(struct name_seq *nseq, u32 inst, | 372 | static struct publication *tipc_nameseq_remove_publ(struct name_seq *nseq, u32 inst, |
373 | u32 node, u32 ref, u32 key) | 373 | u32 node, u32 ref, u32 key) |
374 | { | 374 | { |
375 | struct publication *publ; | 375 | struct publication *publ; |
376 | struct publication *prev; | 376 | struct publication *prev; |
@@ -983,6 +983,7 @@ static void nametbl_list(struct print_buf *buf, u32 depth_info, | |||
983 | } | 983 | } |
984 | } | 984 | } |
985 | 985 | ||
986 | #if 0 | ||
986 | void tipc_nametbl_print(struct print_buf *buf, const char *str) | 987 | void tipc_nametbl_print(struct print_buf *buf, const char *str) |
987 | { | 988 | { |
988 | tipc_printf(buf, str); | 989 | tipc_printf(buf, str); |
@@ -990,6 +991,7 @@ void tipc_nametbl_print(struct print_buf *buf, const char *str) | |||
990 | nametbl_list(buf, 0, 0, 0, 0); | 991 | nametbl_list(buf, 0, 0, 0, 0); |
991 | read_unlock_bh(&tipc_nametbl_lock); | 992 | read_unlock_bh(&tipc_nametbl_lock); |
992 | } | 993 | } |
994 | #endif | ||
993 | 995 | ||
994 | #define MAX_NAME_TBL_QUERY 32768 | 996 | #define MAX_NAME_TBL_QUERY 32768 |
995 | 997 | ||
@@ -1023,10 +1025,12 @@ struct sk_buff *tipc_nametbl_get(const void *req_tlv_area, int req_tlv_space) | |||
1023 | return buf; | 1025 | return buf; |
1024 | } | 1026 | } |
1025 | 1027 | ||
1028 | #if 0 | ||
1026 | void tipc_nametbl_dump(void) | 1029 | void tipc_nametbl_dump(void) |
1027 | { | 1030 | { |
1028 | nametbl_list(TIPC_CONS, 0, 0, 0, 0); | 1031 | nametbl_list(TIPC_CONS, 0, 0, 0, 0); |
1029 | } | 1032 | } |
1033 | #endif | ||
1030 | 1034 | ||
1031 | int tipc_nametbl_init(void) | 1035 | int tipc_nametbl_init(void) |
1032 | { | 1036 | { |
diff --git a/net/tipc/net.c b/net/tipc/net.c index cd0328601bba..f7c8223ddf7d 100644 --- a/net/tipc/net.c +++ b/net/tipc/net.c | |||
@@ -128,13 +128,14 @@ u32 tipc_net_select_router(u32 addr, u32 ref) | |||
128 | return tipc_zone_select_router(tipc_net.zones[tipc_zone(addr)], addr, ref); | 128 | return tipc_zone_select_router(tipc_net.zones[tipc_zone(addr)], addr, ref); |
129 | } | 129 | } |
130 | 130 | ||
131 | 131 | #if 0 | |
132 | u32 tipc_net_next_node(u32 a) | 132 | u32 tipc_net_next_node(u32 a) |
133 | { | 133 | { |
134 | if (tipc_net.zones[tipc_zone(a)]) | 134 | if (tipc_net.zones[tipc_zone(a)]) |
135 | return tipc_zone_next_node(a); | 135 | return tipc_zone_next_node(a); |
136 | return 0; | 136 | return 0; |
137 | } | 137 | } |
138 | #endif | ||
138 | 139 | ||
139 | void tipc_net_remove_as_router(u32 router) | 140 | void tipc_net_remove_as_router(u32 router) |
140 | { | 141 | { |
diff --git a/net/tipc/node.c b/net/tipc/node.c index 9f23845d11b2..0d5db06e203f 100644 --- a/net/tipc/node.c +++ b/net/tipc/node.c | |||
@@ -214,7 +214,7 @@ int tipc_node_has_redundant_links(struct node *n_ptr) | |||
214 | (n_ptr->active_links[0] != n_ptr->active_links[1])); | 214 | (n_ptr->active_links[0] != n_ptr->active_links[1])); |
215 | } | 215 | } |
216 | 216 | ||
217 | int tipc_node_has_active_routes(struct node *n_ptr) | 217 | static int tipc_node_has_active_routes(struct node *n_ptr) |
218 | { | 218 | { |
219 | return (n_ptr && (n_ptr->last_router >= 0)); | 219 | return (n_ptr && (n_ptr->last_router >= 0)); |
220 | } | 220 | } |