aboutsummaryrefslogtreecommitdiffstats
path: root/net/tipc
diff options
context:
space:
mode:
authorSam Ravnborg <sam@ravnborg.org>2006-03-21 01:37:04 -0500
committerDavid S. Miller <davem@davemloft.net>2006-03-21 01:37:04 -0500
commit05790c6456f144024e655710347b3df499260374 (patch)
tree389e85554c0ce7cf732998f2ac9dfeb441e85320 /net/tipc
parent1fc54d8f49c1270c584803437fb7c0ac543588c1 (diff)
[TIPC]: Remove inlines from *.c
With reference to latest discussions on linux-kernel with respect to inline here is a patch for tipc to remove all inlines as used in the .c files. See also chapter 14 in Documentation/CodingStyle. Before: text data bss dec hex filename 102990 5292 1752 110034 1add2 tipc.o Now: text data bss dec hex filename 101190 5292 1752 108234 1a6ca tipc.o This is a nice text size reduction which will improve icache usage. In some cases bigger (> 4 lines) functions where declared inline and used in many places, they are most probarly no longer inlined by gcc resulting in the size reduction. There are several one liners that no longer are declared inline, but gcc should inline these just fine without the inline hint. With this patch applied one warning is added about an unused static function - that was hidded by utilising inline before. The function in question were kept so this patch is solely a inline removal patch. Signed-off-by: Sam Ravnborg <sam@ravnborg.org> Signed-off-by: Per Liden <per.liden@ericsson.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/tipc')
-rw-r--r--net/tipc/bcast.c12
-rw-r--r--net/tipc/link.c58
-rw-r--r--net/tipc/name_table.c6
-rw-r--r--net/tipc/port.c14
-rw-r--r--net/tipc/socket.c14
-rw-r--r--net/tipc/subscr.c2
6 files changed, 53 insertions, 53 deletions
diff --git a/net/tipc/bcast.c b/net/tipc/bcast.c
index a926cec24119..64cca6479560 100644
--- a/net/tipc/bcast.c
+++ b/net/tipc/bcast.c
@@ -107,22 +107,22 @@ static spinlock_t bc_lock = SPIN_LOCK_UNLOCKED;
107char tipc_bclink_name[] = "multicast-link"; 107char tipc_bclink_name[] = "multicast-link";
108 108
109 109
110static inline u32 buf_seqno(struct sk_buff *buf) 110static u32 buf_seqno(struct sk_buff *buf)
111{ 111{
112 return msg_seqno(buf_msg(buf)); 112 return msg_seqno(buf_msg(buf));
113} 113}
114 114
115static inline u32 bcbuf_acks(struct sk_buff *buf) 115static u32 bcbuf_acks(struct sk_buff *buf)
116{ 116{
117 return (u32)(unsigned long)TIPC_SKB_CB(buf)->handle; 117 return (u32)(unsigned long)TIPC_SKB_CB(buf)->handle;
118} 118}
119 119
120static inline void bcbuf_set_acks(struct sk_buff *buf, u32 acks) 120static void bcbuf_set_acks(struct sk_buff *buf, u32 acks)
121{ 121{
122 TIPC_SKB_CB(buf)->handle = (void *)(unsigned long)acks; 122 TIPC_SKB_CB(buf)->handle = (void *)(unsigned long)acks;
123} 123}
124 124
125static inline void bcbuf_decr_acks(struct sk_buff *buf) 125static void bcbuf_decr_acks(struct sk_buff *buf)
126{ 126{
127 bcbuf_set_acks(buf, bcbuf_acks(buf) - 1); 127 bcbuf_set_acks(buf, bcbuf_acks(buf) - 1);
128} 128}
@@ -134,7 +134,7 @@ static inline void bcbuf_decr_acks(struct sk_buff *buf)
134 * Called with 'node' locked, bc_lock unlocked 134 * Called with 'node' locked, bc_lock unlocked
135 */ 135 */
136 136
137static inline void bclink_set_gap(struct node *n_ptr) 137static void bclink_set_gap(struct node *n_ptr)
138{ 138{
139 struct sk_buff *buf = n_ptr->bclink.deferred_head; 139 struct sk_buff *buf = n_ptr->bclink.deferred_head;
140 140
@@ -154,7 +154,7 @@ static inline void bclink_set_gap(struct node *n_ptr)
154 * distribute NACKs, but tries to use the same spacing (divide by 16). 154 * distribute NACKs, but tries to use the same spacing (divide by 16).
155 */ 155 */
156 156
157static inline int bclink_ack_allowed(u32 n) 157static int bclink_ack_allowed(u32 n)
158{ 158{
159 return((n % TIPC_MIN_LINK_WIN) == tipc_own_tag); 159 return((n % TIPC_MIN_LINK_WIN) == tipc_own_tag);
160} 160}
diff --git a/net/tipc/link.c b/net/tipc/link.c
index bbdca3beaaf9..f638863b0d74 100644
--- a/net/tipc/link.c
+++ b/net/tipc/link.c
@@ -157,13 +157,13 @@ static void link_print(struct link *l_ptr, struct print_buf *buf,
157 } \ 157 } \
158} while (0) 158} while (0)
159 159
160static inline void dbg_print_link(struct link *l_ptr, const char *str) 160static void dbg_print_link(struct link *l_ptr, const char *str)
161{ 161{
162 if (DBG_OUTPUT) 162 if (DBG_OUTPUT)
163 link_print(l_ptr, DBG_OUTPUT, str); 163 link_print(l_ptr, DBG_OUTPUT, str);
164} 164}
165 165
166static inline void dbg_print_buf_chain(struct sk_buff *root_buf) 166static void dbg_print_buf_chain(struct sk_buff *root_buf)
167{ 167{
168 if (DBG_OUTPUT) { 168 if (DBG_OUTPUT) {
169 struct sk_buff *buf = root_buf; 169 struct sk_buff *buf = root_buf;
@@ -176,50 +176,50 @@ static inline void dbg_print_buf_chain(struct sk_buff *root_buf)
176} 176}
177 177
178/* 178/*
179 * Simple inlined link routines 179 * Simple link routines
180 */ 180 */
181 181
182static inline unsigned int align(unsigned int i) 182static unsigned int align(unsigned int i)
183{ 183{
184 return (i + 3) & ~3u; 184 return (i + 3) & ~3u;
185} 185}
186 186
187static inline int link_working_working(struct link *l_ptr) 187static int link_working_working(struct link *l_ptr)
188{ 188{
189 return (l_ptr->state == WORKING_WORKING); 189 return (l_ptr->state == WORKING_WORKING);
190} 190}
191 191
192static inline int link_working_unknown(struct link *l_ptr) 192static int link_working_unknown(struct link *l_ptr)
193{ 193{
194 return (l_ptr->state == WORKING_UNKNOWN); 194 return (l_ptr->state == WORKING_UNKNOWN);
195} 195}
196 196
197static inline int link_reset_unknown(struct link *l_ptr) 197static int link_reset_unknown(struct link *l_ptr)
198{ 198{
199 return (l_ptr->state == RESET_UNKNOWN); 199 return (l_ptr->state == RESET_UNKNOWN);
200} 200}
201 201
202static inline int link_reset_reset(struct link *l_ptr) 202static int link_reset_reset(struct link *l_ptr)
203{ 203{
204 return (l_ptr->state == RESET_RESET); 204 return (l_ptr->state == RESET_RESET);
205} 205}
206 206
207static inline int link_blocked(struct link *l_ptr) 207static int link_blocked(struct link *l_ptr)
208{ 208{
209 return (l_ptr->exp_msg_count || l_ptr->blocked); 209 return (l_ptr->exp_msg_count || l_ptr->blocked);
210} 210}
211 211
212static inline int link_congested(struct link *l_ptr) 212static int link_congested(struct link *l_ptr)
213{ 213{
214 return (l_ptr->out_queue_size >= l_ptr->queue_limit[0]); 214 return (l_ptr->out_queue_size >= l_ptr->queue_limit[0]);
215} 215}
216 216
217static inline u32 link_max_pkt(struct link *l_ptr) 217static u32 link_max_pkt(struct link *l_ptr)
218{ 218{
219 return l_ptr->max_pkt; 219 return l_ptr->max_pkt;
220} 220}
221 221
222static inline void link_init_max_pkt(struct link *l_ptr) 222static void link_init_max_pkt(struct link *l_ptr)
223{ 223{
224 u32 max_pkt; 224 u32 max_pkt;
225 225
@@ -236,20 +236,20 @@ static inline void link_init_max_pkt(struct link *l_ptr)
236 l_ptr->max_pkt_probes = 0; 236 l_ptr->max_pkt_probes = 0;
237} 237}
238 238
239static inline u32 link_next_sent(struct link *l_ptr) 239static u32 link_next_sent(struct link *l_ptr)
240{ 240{
241 if (l_ptr->next_out) 241 if (l_ptr->next_out)
242 return msg_seqno(buf_msg(l_ptr->next_out)); 242 return msg_seqno(buf_msg(l_ptr->next_out));
243 return mod(l_ptr->next_out_no); 243 return mod(l_ptr->next_out_no);
244} 244}
245 245
246static inline u32 link_last_sent(struct link *l_ptr) 246static u32 link_last_sent(struct link *l_ptr)
247{ 247{
248 return mod(link_next_sent(l_ptr) - 1); 248 return mod(link_next_sent(l_ptr) - 1);
249} 249}
250 250
251/* 251/*
252 * Simple non-inlined link routines (i.e. referenced outside this file) 252 * Simple non-static link routines (i.e. referenced outside this file)
253 */ 253 */
254 254
255int tipc_link_is_up(struct link *l_ptr) 255int tipc_link_is_up(struct link *l_ptr)
@@ -396,7 +396,7 @@ static void link_timeout(struct link *l_ptr)
396 tipc_node_unlock(l_ptr->owner); 396 tipc_node_unlock(l_ptr->owner);
397} 397}
398 398
399static inline void link_set_timer(struct link *l_ptr, u32 time) 399static void link_set_timer(struct link *l_ptr, u32 time)
400{ 400{
401 k_start_timer(&l_ptr->timer, time); 401 k_start_timer(&l_ptr->timer, time);
402} 402}
@@ -1004,9 +1004,9 @@ static int link_bundle_buf(struct link *l_ptr,
1004 return 1; 1004 return 1;
1005} 1005}
1006 1006
1007static inline void link_add_to_outqueue(struct link *l_ptr, 1007static void link_add_to_outqueue(struct link *l_ptr,
1008 struct sk_buff *buf, 1008 struct sk_buff *buf,
1009 struct tipc_msg *msg) 1009 struct tipc_msg *msg)
1010{ 1010{
1011 u32 ack = mod(l_ptr->next_in_no - 1); 1011 u32 ack = mod(l_ptr->next_in_no - 1);
1012 u32 seqno = mod(l_ptr->next_out_no++); 1012 u32 seqno = mod(l_ptr->next_out_no++);
@@ -1156,8 +1156,8 @@ int tipc_link_send(struct sk_buff *buf, u32 dest, u32 selector)
1156 * Link is locked. Returns user data length. 1156 * Link is locked. Returns user data length.
1157 */ 1157 */
1158 1158
1159static inline int link_send_buf_fast(struct link *l_ptr, struct sk_buff *buf, 1159static int link_send_buf_fast(struct link *l_ptr, struct sk_buff *buf,
1160 u32 *used_max_pkt) 1160 u32 *used_max_pkt)
1161{ 1161{
1162 struct tipc_msg *msg = buf_msg(buf); 1162 struct tipc_msg *msg = buf_msg(buf);
1163 int res = msg_data_sz(msg); 1163 int res = msg_data_sz(msg);
@@ -2539,42 +2539,42 @@ exit:
2539 * pending message. This makes dynamic memory allocation unecessary. 2539 * pending message. This makes dynamic memory allocation unecessary.
2540 */ 2540 */
2541 2541
2542static inline u32 get_long_msg_seqno(struct sk_buff *buf) 2542static u32 get_long_msg_seqno(struct sk_buff *buf)
2543{ 2543{
2544 return msg_seqno(buf_msg(buf)); 2544 return msg_seqno(buf_msg(buf));
2545} 2545}
2546 2546
2547static inline void set_long_msg_seqno(struct sk_buff *buf, u32 seqno) 2547static void set_long_msg_seqno(struct sk_buff *buf, u32 seqno)
2548{ 2548{
2549 msg_set_seqno(buf_msg(buf), seqno); 2549 msg_set_seqno(buf_msg(buf), seqno);
2550} 2550}
2551 2551
2552static inline u32 get_fragm_size(struct sk_buff *buf) 2552static u32 get_fragm_size(struct sk_buff *buf)
2553{ 2553{
2554 return msg_ack(buf_msg(buf)); 2554 return msg_ack(buf_msg(buf));
2555} 2555}
2556 2556
2557static inline void set_fragm_size(struct sk_buff *buf, u32 sz) 2557static void set_fragm_size(struct sk_buff *buf, u32 sz)
2558{ 2558{
2559 msg_set_ack(buf_msg(buf), sz); 2559 msg_set_ack(buf_msg(buf), sz);
2560} 2560}
2561 2561
2562static inline u32 get_expected_frags(struct sk_buff *buf) 2562static u32 get_expected_frags(struct sk_buff *buf)
2563{ 2563{
2564 return msg_bcast_ack(buf_msg(buf)); 2564 return msg_bcast_ack(buf_msg(buf));
2565} 2565}
2566 2566
2567static inline void set_expected_frags(struct sk_buff *buf, u32 exp) 2567static void set_expected_frags(struct sk_buff *buf, u32 exp)
2568{ 2568{
2569 msg_set_bcast_ack(buf_msg(buf), exp); 2569 msg_set_bcast_ack(buf_msg(buf), exp);
2570} 2570}
2571 2571
2572static inline u32 get_timer_cnt(struct sk_buff *buf) 2572static u32 get_timer_cnt(struct sk_buff *buf)
2573{ 2573{
2574 return msg_reroute_cnt(buf_msg(buf)); 2574 return msg_reroute_cnt(buf_msg(buf));
2575} 2575}
2576 2576
2577static inline void incr_timer_cnt(struct sk_buff *buf) 2577static void incr_timer_cnt(struct sk_buff *buf)
2578{ 2578{
2579 msg_incr_reroute_cnt(buf_msg(buf)); 2579 msg_incr_reroute_cnt(buf_msg(buf));
2580} 2580}
diff --git a/net/tipc/name_table.c b/net/tipc/name_table.c
index a865954bd95c..7be44d4aab75 100644
--- a/net/tipc/name_table.c
+++ b/net/tipc/name_table.c
@@ -104,7 +104,7 @@ static atomic_t rsv_publ_ok = ATOMIC_INIT(0);
104rwlock_t tipc_nametbl_lock = RW_LOCK_UNLOCKED; 104rwlock_t tipc_nametbl_lock = RW_LOCK_UNLOCKED;
105 105
106 106
107static inline int hash(int x) 107static int hash(int x)
108{ 108{
109 return(x & (tipc_nametbl_size - 1)); 109 return(x & (tipc_nametbl_size - 1));
110} 110}
@@ -190,8 +190,8 @@ struct name_seq *tipc_nameseq_create(u32 type, struct hlist_head *seq_head)
190 * Very time-critical, so binary searches through sub-sequence array. 190 * Very time-critical, so binary searches through sub-sequence array.
191 */ 191 */
192 192
193static inline struct sub_seq *nameseq_find_subseq(struct name_seq *nseq, 193static struct sub_seq *nameseq_find_subseq(struct name_seq *nseq,
194 u32 instance) 194 u32 instance)
195{ 195{
196 struct sub_seq *sseqs = nseq->sseqs; 196 struct sub_seq *sseqs = nseq->sseqs;
197 int low = 0; 197 int low = 0;
diff --git a/net/tipc/port.c b/net/tipc/port.c
index 294375cd9bda..4d3b7ccd2561 100644
--- a/net/tipc/port.c
+++ b/net/tipc/port.c
@@ -67,27 +67,27 @@ static struct sk_buff* port_build_peer_abort_msg(struct port *,u32 err);
67static void port_timeout(unsigned long ref); 67static void port_timeout(unsigned long ref);
68 68
69 69
70static inline u32 port_peernode(struct port *p_ptr) 70static u32 port_peernode(struct port *p_ptr)
71{ 71{
72 return msg_destnode(&p_ptr->publ.phdr); 72 return msg_destnode(&p_ptr->publ.phdr);
73} 73}
74 74
75static inline u32 port_peerport(struct port *p_ptr) 75static u32 port_peerport(struct port *p_ptr)
76{ 76{
77 return msg_destport(&p_ptr->publ.phdr); 77 return msg_destport(&p_ptr->publ.phdr);
78} 78}
79 79
80static inline u32 port_out_seqno(struct port *p_ptr) 80static u32 port_out_seqno(struct port *p_ptr)
81{ 81{
82 return msg_transp_seqno(&p_ptr->publ.phdr); 82 return msg_transp_seqno(&p_ptr->publ.phdr);
83} 83}
84 84
85static inline void port_set_out_seqno(struct port *p_ptr, u32 seqno) 85static void port_set_out_seqno(struct port *p_ptr, u32 seqno)
86{ 86{
87 msg_set_transp_seqno(&p_ptr->publ.phdr,seqno); 87 msg_set_transp_seqno(&p_ptr->publ.phdr,seqno);
88} 88}
89 89
90static inline void port_incr_out_seqno(struct port *p_ptr) 90static void port_incr_out_seqno(struct port *p_ptr)
91{ 91{
92 struct tipc_msg *m = &p_ptr->publ.phdr; 92 struct tipc_msg *m = &p_ptr->publ.phdr;
93 93
@@ -335,7 +335,7 @@ void *tipc_get_handle(const u32 ref)
335 return handle; 335 return handle;
336} 336}
337 337
338static inline int port_unreliable(struct port *p_ptr) 338static int port_unreliable(struct port *p_ptr)
339{ 339{
340 return msg_src_droppable(&p_ptr->publ.phdr); 340 return msg_src_droppable(&p_ptr->publ.phdr);
341} 341}
@@ -364,7 +364,7 @@ int tipc_set_portunreliable(u32 ref, unsigned int isunreliable)
364 return TIPC_OK; 364 return TIPC_OK;
365} 365}
366 366
367static inline int port_unreturnable(struct port *p_ptr) 367static int port_unreturnable(struct port *p_ptr)
368{ 368{
369 return msg_dest_droppable(&p_ptr->publ.phdr); 369 return msg_dest_droppable(&p_ptr->publ.phdr);
370} 370}
diff --git a/net/tipc/socket.c b/net/tipc/socket.c
index d1347d7da147..648a734e6044 100644
--- a/net/tipc/socket.c
+++ b/net/tipc/socket.c
@@ -88,7 +88,7 @@ static atomic_t tipc_queue_size = ATOMIC_INIT(0);
88 * with non-socket interfaces. 88 * with non-socket interfaces.
89 * See net.c for description of locking policy. 89 * See net.c for description of locking policy.
90 */ 90 */
91static inline void sock_lock(struct tipc_sock* tsock) 91static void sock_lock(struct tipc_sock* tsock)
92{ 92{
93 spin_lock_bh(tsock->p->lock); 93 spin_lock_bh(tsock->p->lock);
94} 94}
@@ -96,7 +96,7 @@ static inline void sock_lock(struct tipc_sock* tsock)
96/* 96/*
97 * sock_unlock(): Unlock a port/socket pair 97 * sock_unlock(): Unlock a port/socket pair
98 */ 98 */
99static inline void sock_unlock(struct tipc_sock* tsock) 99static void sock_unlock(struct tipc_sock* tsock)
100{ 100{
101 spin_unlock_bh(tsock->p->lock); 101 spin_unlock_bh(tsock->p->lock);
102} 102}
@@ -119,7 +119,7 @@ static inline void sock_unlock(struct tipc_sock* tsock)
119 * Returns pollmask value 119 * Returns pollmask value
120 */ 120 */
121 121
122static inline u32 pollmask(struct socket *sock) 122static u32 pollmask(struct socket *sock)
123{ 123{
124 u32 mask; 124 u32 mask;
125 125
@@ -144,7 +144,7 @@ static inline u32 pollmask(struct socket *sock)
144 * @tsock: TIPC socket 144 * @tsock: TIPC socket
145 */ 145 */
146 146
147static inline void advance_queue(struct tipc_sock *tsock) 147static void advance_queue(struct tipc_sock *tsock)
148{ 148{
149 sock_lock(tsock); 149 sock_lock(tsock);
150 buf_discard(skb_dequeue(&tsock->sk.sk_receive_queue)); 150 buf_discard(skb_dequeue(&tsock->sk.sk_receive_queue));
@@ -412,7 +412,7 @@ static unsigned int poll(struct file *file, struct socket *sock,
412 * Returns 0 if permission is granted, otherwise errno 412 * Returns 0 if permission is granted, otherwise errno
413 */ 413 */
414 414
415static inline int dest_name_check(struct sockaddr_tipc *dest, struct msghdr *m) 415static int dest_name_check(struct sockaddr_tipc *dest, struct msghdr *m)
416{ 416{
417 struct tipc_cfg_msg_hdr hdr; 417 struct tipc_cfg_msg_hdr hdr;
418 418
@@ -695,7 +695,7 @@ static int auto_connect(struct socket *sock, struct tipc_sock *tsock,
695 * Note: Address is not captured if not requested by receiver. 695 * Note: Address is not captured if not requested by receiver.
696 */ 696 */
697 697
698static inline void set_orig_addr(struct msghdr *m, struct tipc_msg *msg) 698static void set_orig_addr(struct msghdr *m, struct tipc_msg *msg)
699{ 699{
700 struct sockaddr_tipc *addr = (struct sockaddr_tipc *)m->msg_name; 700 struct sockaddr_tipc *addr = (struct sockaddr_tipc *)m->msg_name;
701 701
@@ -721,7 +721,7 @@ static inline void set_orig_addr(struct msghdr *m, struct tipc_msg *msg)
721 * Returns 0 if successful, otherwise errno 721 * Returns 0 if successful, otherwise errno
722 */ 722 */
723 723
724static inline int anc_data_recv(struct msghdr *m, struct tipc_msg *msg, 724static int anc_data_recv(struct msghdr *m, struct tipc_msg *msg,
725 struct tipc_port *tport) 725 struct tipc_port *tport)
726{ 726{
727 u32 anc_data[3]; 727 u32 anc_data[3];
diff --git a/net/tipc/subscr.c b/net/tipc/subscr.c
index 3ec4e2b4e750..c5f026c7fd38 100644
--- a/net/tipc/subscr.c
+++ b/net/tipc/subscr.c
@@ -86,7 +86,7 @@ static struct top_srv topsrv = { 0 };
86 * Returns converted value 86 * Returns converted value
87 */ 87 */
88 88
89static inline u32 htohl(u32 in, int swap) 89static u32 htohl(u32 in, int swap)
90{ 90{
91 char *c = (char *)&in; 91 char *c = (char *)&in;
92 92