aboutsummaryrefslogtreecommitdiffstats
path: root/net/tipc/msg.h
diff options
context:
space:
mode:
authorYOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>2007-02-09 09:25:21 -0500
committerDavid S. Miller <davem@sunset.davemloft.net>2007-02-11 02:20:15 -0500
commitc43072852649d8382b81237ce51195bcec36f24a (patch)
tree5e55d65bd4d1db35418d2990310bd2c765d60405 /net/tipc/msg.h
parentcca5172a7ec10dfdb0b787cd8e9d5b0b8f179793 (diff)
[NET] TIPC: Fix whitespace errors.
Signed-off-by: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/tipc/msg.h')
-rw-r--r--net/tipc/msg.h138
1 files changed, 69 insertions, 69 deletions
diff --git a/net/tipc/msg.h b/net/tipc/msg.h
index 6699aaf7bd4c..62d549063604 100644
--- a/net/tipc/msg.h
+++ b/net/tipc/msg.h
@@ -1,6 +1,6 @@
1/* 1/*
2 * net/tipc/msg.h: Include file for TIPC message header routines 2 * net/tipc/msg.h: Include file for TIPC message header routines
3 * 3 *
4 * Copyright (c) 2000-2006, Ericsson AB 4 * Copyright (c) 2000-2006, Ericsson AB
5 * Copyright (c) 2005, Wind River Systems 5 * Copyright (c) 2005, Wind River Systems
6 * All rights reserved. 6 * All rights reserved.
@@ -56,10 +56,10 @@
56 56
57/* 57/*
58 TIPC user data message header format, version 2 58 TIPC user data message header format, version 2
59 59
60 - Fundamental definitions available to privileged TIPC users 60 - Fundamental definitions available to privileged TIPC users
61 are located in tipc_msg.h. 61 are located in tipc_msg.h.
62 - Remaining definitions available to TIPC internal users appear below. 62 - Remaining definitions available to TIPC internal users appear below.
63*/ 63*/
64 64
65 65
@@ -75,7 +75,7 @@ static inline void msg_set_bits(struct tipc_msg *m, u32 w,
75 msg_set_word(m, w, (word |= (val << pos))); 75 msg_set_word(m, w, (word |= (val << pos)));
76} 76}
77 77
78/* 78/*
79 * Word 0 79 * Word 0
80 */ 80 */
81 81
@@ -84,7 +84,7 @@ static inline u32 msg_version(struct tipc_msg *m)
84 return msg_bits(m, 0, 29, 7); 84 return msg_bits(m, 0, 29, 7);
85} 85}
86 86
87static inline void msg_set_version(struct tipc_msg *m) 87static inline void msg_set_version(struct tipc_msg *m)
88{ 88{
89 msg_set_bits(m, 0, 29, 0xf, TIPC_VERSION); 89 msg_set_bits(m, 0, 29, 0xf, TIPC_VERSION);
90} 90}
@@ -99,47 +99,47 @@ static inline u32 msg_isdata(struct tipc_msg *m)
99 return (msg_user(m) <= DATA_CRITICAL); 99 return (msg_user(m) <= DATA_CRITICAL);
100} 100}
101 101
102static inline void msg_set_user(struct tipc_msg *m, u32 n) 102static inline void msg_set_user(struct tipc_msg *m, u32 n)
103{ 103{
104 msg_set_bits(m, 0, 25, 0xf, n); 104 msg_set_bits(m, 0, 25, 0xf, n);
105} 105}
106 106
107static inline void msg_set_importance(struct tipc_msg *m, u32 i) 107static inline void msg_set_importance(struct tipc_msg *m, u32 i)
108{ 108{
109 msg_set_user(m, i); 109 msg_set_user(m, i);
110} 110}
111 111
112static inline void msg_set_hdr_sz(struct tipc_msg *m,u32 n) 112static inline void msg_set_hdr_sz(struct tipc_msg *m,u32 n)
113{ 113{
114 msg_set_bits(m, 0, 21, 0xf, n>>2); 114 msg_set_bits(m, 0, 21, 0xf, n>>2);
115} 115}
116 116
117static inline int msg_non_seq(struct tipc_msg *m) 117static inline int msg_non_seq(struct tipc_msg *m)
118{ 118{
119 return msg_bits(m, 0, 20, 1); 119 return msg_bits(m, 0, 20, 1);
120} 120}
121 121
122static inline void msg_set_non_seq(struct tipc_msg *m) 122static inline void msg_set_non_seq(struct tipc_msg *m)
123{ 123{
124 msg_set_bits(m, 0, 20, 1, 1); 124 msg_set_bits(m, 0, 20, 1, 1);
125} 125}
126 126
127static inline int msg_dest_droppable(struct tipc_msg *m) 127static inline int msg_dest_droppable(struct tipc_msg *m)
128{ 128{
129 return msg_bits(m, 0, 19, 1); 129 return msg_bits(m, 0, 19, 1);
130} 130}
131 131
132static inline void msg_set_dest_droppable(struct tipc_msg *m, u32 d) 132static inline void msg_set_dest_droppable(struct tipc_msg *m, u32 d)
133{ 133{
134 msg_set_bits(m, 0, 19, 1, d); 134 msg_set_bits(m, 0, 19, 1, d);
135} 135}
136 136
137static inline int msg_src_droppable(struct tipc_msg *m) 137static inline int msg_src_droppable(struct tipc_msg *m)
138{ 138{
139 return msg_bits(m, 0, 18, 1); 139 return msg_bits(m, 0, 18, 1);
140} 140}
141 141
142static inline void msg_set_src_droppable(struct tipc_msg *m, u32 d) 142static inline void msg_set_src_droppable(struct tipc_msg *m, u32 d)
143{ 143{
144 msg_set_bits(m, 0, 18, 1, d); 144 msg_set_bits(m, 0, 18, 1, d);
145} 145}
@@ -150,31 +150,31 @@ static inline void msg_set_size(struct tipc_msg *m, u32 sz)
150} 150}
151 151
152 152
153/* 153/*
154 * Word 1 154 * Word 1
155 */ 155 */
156 156
157static inline void msg_set_type(struct tipc_msg *m, u32 n) 157static inline void msg_set_type(struct tipc_msg *m, u32 n)
158{ 158{
159 msg_set_bits(m, 1, 29, 0x7, n); 159 msg_set_bits(m, 1, 29, 0x7, n);
160} 160}
161 161
162static inline void msg_set_errcode(struct tipc_msg *m, u32 err) 162static inline void msg_set_errcode(struct tipc_msg *m, u32 err)
163{ 163{
164 msg_set_bits(m, 1, 25, 0xf, err); 164 msg_set_bits(m, 1, 25, 0xf, err);
165} 165}
166 166
167static inline u32 msg_reroute_cnt(struct tipc_msg *m) 167static inline u32 msg_reroute_cnt(struct tipc_msg *m)
168{ 168{
169 return msg_bits(m, 1, 21, 0xf); 169 return msg_bits(m, 1, 21, 0xf);
170} 170}
171 171
172static inline void msg_incr_reroute_cnt(struct tipc_msg *m) 172static inline void msg_incr_reroute_cnt(struct tipc_msg *m)
173{ 173{
174 msg_set_bits(m, 1, 21, 0xf, msg_reroute_cnt(m) + 1); 174 msg_set_bits(m, 1, 21, 0xf, msg_reroute_cnt(m) + 1);
175} 175}
176 176
177static inline void msg_reset_reroute_cnt(struct tipc_msg *m) 177static inline void msg_reset_reroute_cnt(struct tipc_msg *m)
178{ 178{
179 msg_set_bits(m, 1, 21, 0xf, 0); 179 msg_set_bits(m, 1, 21, 0xf, 0);
180} 180}
@@ -184,12 +184,12 @@ static inline u32 msg_lookup_scope(struct tipc_msg *m)
184 return msg_bits(m, 1, 19, 0x3); 184 return msg_bits(m, 1, 19, 0x3);
185} 185}
186 186
187static inline void msg_set_lookup_scope(struct tipc_msg *m, u32 n) 187static inline void msg_set_lookup_scope(struct tipc_msg *m, u32 n)
188{ 188{
189 msg_set_bits(m, 1, 19, 0x3, n); 189 msg_set_bits(m, 1, 19, 0x3, n);
190} 190}
191 191
192static inline void msg_set_options(struct tipc_msg *m, const char *opt, u32 sz) 192static inline void msg_set_options(struct tipc_msg *m, const char *opt, u32 sz)
193{ 193{
194 u32 hsz = msg_hdr_sz(m); 194 u32 hsz = msg_hdr_sz(m);
195 char *to = (char *)&m->hdr[hsz/4]; 195 char *to = (char *)&m->hdr[hsz/4];
@@ -206,13 +206,13 @@ static inline u32 msg_bcast_ack(struct tipc_msg *m)
206 return msg_bits(m, 1, 0, 0xffff); 206 return msg_bits(m, 1, 0, 0xffff);
207} 207}
208 208
209static inline void msg_set_bcast_ack(struct tipc_msg *m, u32 n) 209static inline void msg_set_bcast_ack(struct tipc_msg *m, u32 n)
210{ 210{
211 msg_set_bits(m, 1, 0, 0xffff, n); 211 msg_set_bits(m, 1, 0, 0xffff, n);
212} 212}
213 213
214 214
215/* 215/*
216 * Word 2 216 * Word 2
217 */ 217 */
218 218
@@ -221,7 +221,7 @@ static inline u32 msg_ack(struct tipc_msg *m)
221 return msg_bits(m, 2, 16, 0xffff); 221 return msg_bits(m, 2, 16, 0xffff);
222} 222}
223 223
224static inline void msg_set_ack(struct tipc_msg *m, u32 n) 224static inline void msg_set_ack(struct tipc_msg *m, u32 n)
225{ 225{
226 msg_set_bits(m, 2, 16, 0xffff, n); 226 msg_set_bits(m, 2, 16, 0xffff, n);
227} 227}
@@ -231,48 +231,48 @@ static inline u32 msg_seqno(struct tipc_msg *m)
231 return msg_bits(m, 2, 0, 0xffff); 231 return msg_bits(m, 2, 0, 0xffff);
232} 232}
233 233
234static inline void msg_set_seqno(struct tipc_msg *m, u32 n) 234static inline void msg_set_seqno(struct tipc_msg *m, u32 n)
235{ 235{
236 msg_set_bits(m, 2, 0, 0xffff, n); 236 msg_set_bits(m, 2, 0, 0xffff, n);
237} 237}
238 238
239 239
240/* 240/*
241 * Words 3-10 241 * Words 3-10
242 */ 242 */
243 243
244 244
245static inline void msg_set_prevnode(struct tipc_msg *m, u32 a) 245static inline void msg_set_prevnode(struct tipc_msg *m, u32 a)
246{ 246{
247 msg_set_word(m, 3, a); 247 msg_set_word(m, 3, a);
248} 248}
249 249
250static inline void msg_set_origport(struct tipc_msg *m, u32 p) 250static inline void msg_set_origport(struct tipc_msg *m, u32 p)
251{ 251{
252 msg_set_word(m, 4, p); 252 msg_set_word(m, 4, p);
253} 253}
254 254
255static inline void msg_set_destport(struct tipc_msg *m, u32 p) 255static inline void msg_set_destport(struct tipc_msg *m, u32 p)
256{ 256{
257 msg_set_word(m, 5, p); 257 msg_set_word(m, 5, p);
258} 258}
259 259
260static inline void msg_set_mc_netid(struct tipc_msg *m, u32 p) 260static inline void msg_set_mc_netid(struct tipc_msg *m, u32 p)
261{ 261{
262 msg_set_word(m, 5, p); 262 msg_set_word(m, 5, p);
263} 263}
264 264
265static inline void msg_set_orignode(struct tipc_msg *m, u32 a) 265static inline void msg_set_orignode(struct tipc_msg *m, u32 a)
266{ 266{
267 msg_set_word(m, 6, a); 267 msg_set_word(m, 6, a);
268} 268}
269 269
270static inline void msg_set_destnode(struct tipc_msg *m, u32 a) 270static inline void msg_set_destnode(struct tipc_msg *m, u32 a)
271{ 271{
272 msg_set_word(m, 7, a); 272 msg_set_word(m, 7, a);
273} 273}
274 274
275static inline int msg_is_dest(struct tipc_msg *m, u32 d) 275static inline int msg_is_dest(struct tipc_msg *m, u32 d)
276{ 276{
277 return(msg_short(m) || (msg_destnode(m) == d)); 277 return(msg_short(m) || (msg_destnode(m) == d));
278} 278}
@@ -284,7 +284,7 @@ static inline u32 msg_routed(struct tipc_msg *m)
284 return(msg_destnode(m) ^ msg_orignode(m)) >> 11; 284 return(msg_destnode(m) ^ msg_orignode(m)) >> 11;
285} 285}
286 286
287static inline void msg_set_nametype(struct tipc_msg *m, u32 n) 287static inline void msg_set_nametype(struct tipc_msg *m, u32 n)
288{ 288{
289 msg_set_word(m, 8, n); 289 msg_set_word(m, 8, n);
290} 290}
@@ -309,17 +309,17 @@ static inline void msg_set_transp_seqno(struct tipc_msg *m, u32 n)
309 msg_set_word(m, 8, n); 309 msg_set_word(m, 8, n);
310} 310}
311 311
312static inline void msg_set_namelower(struct tipc_msg *m, u32 n) 312static inline void msg_set_namelower(struct tipc_msg *m, u32 n)
313{ 313{
314 msg_set_word(m, 9, n); 314 msg_set_word(m, 9, n);
315} 315}
316 316
317static inline void msg_set_nameinst(struct tipc_msg *m, u32 n) 317static inline void msg_set_nameinst(struct tipc_msg *m, u32 n)
318{ 318{
319 msg_set_namelower(m, n); 319 msg_set_namelower(m, n);
320} 320}
321 321
322static inline void msg_set_nameupper(struct tipc_msg *m, u32 n) 322static inline void msg_set_nameupper(struct tipc_msg *m, u32 n)
323{ 323{
324 msg_set_word(m, 10, n); 324 msg_set_word(m, 10, n);
325} 325}
@@ -329,7 +329,7 @@ static inline struct tipc_msg *msg_get_wrapped(struct tipc_msg *m)
329 return (struct tipc_msg *)msg_data(m); 329 return (struct tipc_msg *)msg_data(m);
330} 330}
331 331
332static inline void msg_expand(struct tipc_msg *m, u32 destnode) 332static inline void msg_expand(struct tipc_msg *m, u32 destnode)
333{ 333{
334 if (!msg_short(m)) 334 if (!msg_short(m))
335 return; 335 return;
@@ -344,7 +344,7 @@ static inline void msg_expand(struct tipc_msg *m, u32 destnode)
344/* 344/*
345 TIPC internal message header format, version 2 345 TIPC internal message header format, version 2
346 346
347 1 0 9 8 7 6 5 4|3 2 1 0 9 8 7 6|5 4 3 2 1 0 9 8|7 6 5 4 3 2 1 0 347 1 0 9 8 7 6 5 4|3 2 1 0 9 8 7 6|5 4 3 2 1 0 9 8|7 6 5 4 3 2 1 0
348 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 348 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
349 w0:|vers |msg usr|hdr sz |n|resrv| packet size | 349 w0:|vers |msg usr|hdr sz |n|resrv| packet size |
350 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 350 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
@@ -372,9 +372,9 @@ static inline void msg_expand(struct tipc_msg *m, u32 destnode)
372 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 372 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
373 373
374 NB: CONN_MANAGER use data message format. LINK_CONFIG has own format. 374 NB: CONN_MANAGER use data message format. LINK_CONFIG has own format.
375*/ 375*/
376 376
377/* 377/*
378 * Internal users 378 * Internal users
379 */ 379 */
380 380
@@ -390,7 +390,7 @@ static inline void msg_expand(struct tipc_msg *m, u32 destnode)
390#define INT_H_SIZE 40 390#define INT_H_SIZE 40
391#define DSC_H_SIZE 40 391#define DSC_H_SIZE 40
392 392
393/* 393/*
394 * Connection management protocol messages 394 * Connection management protocol messages
395 */ 395 */
396 396
@@ -398,7 +398,7 @@ static inline void msg_expand(struct tipc_msg *m, u32 destnode)
398#define CONN_PROBE_REPLY 1 398#define CONN_PROBE_REPLY 1
399#define CONN_ACK 2 399#define CONN_ACK 2
400 400
401/* 401/*
402 * Name distributor messages 402 * Name distributor messages
403 */ 403 */
404 404
@@ -406,7 +406,7 @@ static inline void msg_expand(struct tipc_msg *m, u32 destnode)
406#define WITHDRAWAL 1 406#define WITHDRAWAL 1
407 407
408 408
409/* 409/*
410 * Word 1 410 * Word 1
411 */ 411 */
412 412
@@ -425,13 +425,13 @@ static inline u32 msg_req_links(struct tipc_msg *m)
425 return msg_bits(m, 1, 16, 0xfff); 425 return msg_bits(m, 1, 16, 0xfff);
426} 426}
427 427
428static inline void msg_set_req_links(struct tipc_msg *m, u32 n) 428static inline void msg_set_req_links(struct tipc_msg *m, u32 n)
429{ 429{
430 msg_set_bits(m, 1, 16, 0xfff, n); 430 msg_set_bits(m, 1, 16, 0xfff, n);
431} 431}
432 432
433 433
434/* 434/*
435 * Word 2 435 * Word 2
436 */ 436 */
437 437
@@ -440,7 +440,7 @@ static inline u32 msg_dest_domain(struct tipc_msg *m)
440 return msg_word(m, 2); 440 return msg_word(m, 2);
441} 441}
442 442
443static inline void msg_set_dest_domain(struct tipc_msg *m, u32 n) 443static inline void msg_set_dest_domain(struct tipc_msg *m, u32 n)
444{ 444{
445 msg_set_word(m, 2, n); 445 msg_set_word(m, 2, n);
446} 446}
@@ -460,13 +460,13 @@ static inline u32 msg_bcgap_to(struct tipc_msg *m)
460 return msg_bits(m, 2, 0, 0xffff); 460 return msg_bits(m, 2, 0, 0xffff);
461} 461}
462 462
463static inline void msg_set_bcgap_to(struct tipc_msg *m, u32 n) 463static inline void msg_set_bcgap_to(struct tipc_msg *m, u32 n)
464{ 464{
465 msg_set_bits(m, 2, 0, 0xffff, n); 465 msg_set_bits(m, 2, 0, 0xffff, n);
466} 466}
467 467
468 468
469/* 469/*
470 * Word 4 470 * Word 4
471 */ 471 */
472 472
@@ -533,7 +533,7 @@ static inline void msg_set_link_selector(struct tipc_msg *m, u32 n)
533 msg_set_bits(m, 4, 0, 1, (n & 1)); 533 msg_set_bits(m, 4, 0, 1, (n & 1));
534} 534}
535 535
536/* 536/*
537 * Word 5 537 * Word 5
538 */ 538 */
539 539
@@ -603,7 +603,7 @@ static inline void msg_clear_redundant_link(struct tipc_msg *m)
603} 603}
604 604
605 605
606/* 606/*
607 * Word 9 607 * Word 9
608 */ 608 */
609 609
@@ -627,12 +627,12 @@ static inline void msg_set_bcast_tag(struct tipc_msg *m, u32 n)
627 msg_set_bits(m, 9, 16, 0xffff, n); 627 msg_set_bits(m, 9, 16, 0xffff, n);
628} 628}
629 629
630static inline u32 msg_max_pkt(struct tipc_msg *m) 630static inline u32 msg_max_pkt(struct tipc_msg *m)
631{ 631{
632 return (msg_bits(m, 9, 16, 0xffff) * 4); 632 return (msg_bits(m, 9, 16, 0xffff) * 4);
633} 633}
634 634
635static inline void msg_set_max_pkt(struct tipc_msg *m, u32 n) 635static inline void msg_set_max_pkt(struct tipc_msg *m, u32 n)
636{ 636{
637 msg_set_bits(m, 9, 16, 0xffff, (n / 4)); 637 msg_set_bits(m, 9, 16, 0xffff, (n / 4));
638} 638}
@@ -647,7 +647,7 @@ static inline void msg_set_link_tolerance(struct tipc_msg *m, u32 n)
647 msg_set_bits(m, 9, 0, 0xffff, n); 647 msg_set_bits(m, 9, 0, 0xffff, n);
648} 648}
649 649
650/* 650/*
651 * Routing table message data 651 * Routing table message data
652 */ 652 */
653 653
@@ -672,7 +672,7 @@ static inline void msg_set_dataoctet(struct tipc_msg *m, u32 pos)
672 msg_data(m)[pos + 4] = 1; 672 msg_data(m)[pos + 4] = 1;
673} 673}
674 674
675/* 675/*
676 * Segmentation message types 676 * Segmentation message types
677 */ 677 */
678 678
@@ -680,7 +680,7 @@ static inline void msg_set_dataoctet(struct tipc_msg *m, u32 pos)
680#define FRAGMENT 1 680#define FRAGMENT 1
681#define LAST_FRAGMENT 2 681#define LAST_FRAGMENT 2
682 682
683/* 683/*
684 * Link management protocol message types 684 * Link management protocol message types
685 */ 685 */
686 686
@@ -688,13 +688,13 @@ static inline void msg_set_dataoctet(struct tipc_msg *m, u32 pos)
688#define RESET_MSG 1 688#define RESET_MSG 1
689#define ACTIVATE_MSG 2 689#define ACTIVATE_MSG 2
690 690
691/* 691/*
692 * Changeover tunnel message types 692 * Changeover tunnel message types
693 */ 693 */
694#define DUPLICATE_MSG 0 694#define DUPLICATE_MSG 0
695#define ORIGINAL_MSG 1 695#define ORIGINAL_MSG 1
696 696
697/* 697/*
698 * Routing table message types 698 * Routing table message types
699 */ 699 */
700#define EXT_ROUTING_TABLE 0 700#define EXT_ROUTING_TABLE 0
@@ -703,7 +703,7 @@ static inline void msg_set_dataoctet(struct tipc_msg *m, u32 pos)
703#define ROUTE_ADDITION 3 703#define ROUTE_ADDITION 3
704#define ROUTE_REMOVAL 4 704#define ROUTE_REMOVAL 4
705 705
706/* 706/*
707 * Config protocol message types 707 * Config protocol message types
708 */ 708 */
709 709
@@ -724,7 +724,7 @@ static inline u32 msg_tot_importance(struct tipc_msg *m)
724} 724}
725 725
726 726
727static inline void msg_init(struct tipc_msg *m, u32 user, u32 type, 727static inline void msg_init(struct tipc_msg *m, u32 user, u32 type,
728 u32 err, u32 hsize, u32 destnode) 728 u32 err, u32 hsize, u32 destnode)
729{ 729{
730 memset(m, 0, hsize); 730 memset(m, 0, hsize);
@@ -741,7 +741,7 @@ static inline void msg_init(struct tipc_msg *m, u32 user, u32 type,
741 } 741 }
742} 742}
743 743
744/** 744/**
745 * msg_calc_data_size - determine total data size for message 745 * msg_calc_data_size - determine total data size for message
746 */ 746 */
747 747
@@ -755,15 +755,15 @@ static inline int msg_calc_data_size(struct iovec const *msg_sect, u32 num_sect)
755 return dsz; 755 return dsz;
756} 756}
757 757
758/** 758/**
759 * msg_build - create message using specified header and data 759 * msg_build - create message using specified header and data
760 * 760 *
761 * Note: Caller must not hold any locks in case copy_from_user() is interrupted! 761 * Note: Caller must not hold any locks in case copy_from_user() is interrupted!
762 * 762 *
763 * Returns message data size or errno 763 * Returns message data size or errno
764 */ 764 */
765 765
766static inline int msg_build(struct tipc_msg *hdr, 766static inline int msg_build(struct tipc_msg *hdr,
767 struct iovec const *msg_sect, u32 num_sect, 767 struct iovec const *msg_sect, u32 num_sect,
768 int max_size, int usrmem, struct sk_buff** buf) 768 int max_size, int usrmem, struct sk_buff** buf)
769{ 769{
@@ -789,11 +789,11 @@ static inline int msg_build(struct tipc_msg *hdr,
789 memcpy((*buf)->data, (unchar *)hdr, hsz); 789 memcpy((*buf)->data, (unchar *)hdr, hsz);
790 for (res = 1, cnt = 0; res && (cnt < num_sect); cnt++) { 790 for (res = 1, cnt = 0; res && (cnt < num_sect); cnt++) {
791 if (likely(usrmem)) 791 if (likely(usrmem))
792 res = !copy_from_user((*buf)->data + pos, 792 res = !copy_from_user((*buf)->data + pos,
793 msg_sect[cnt].iov_base, 793 msg_sect[cnt].iov_base,
794 msg_sect[cnt].iov_len); 794 msg_sect[cnt].iov_len);
795 else 795 else
796 memcpy((*buf)->data + pos, msg_sect[cnt].iov_base, 796 memcpy((*buf)->data + pos, msg_sect[cnt].iov_base,
797 msg_sect[cnt].iov_len); 797 msg_sect[cnt].iov_len);
798 pos += msg_sect[cnt].iov_len; 798 pos += msg_sect[cnt].iov_len;
799 } 799 }