Skip to content

Commit 0e65967

Browse files
ajstephensdavem330
authored andcommitted
tipc: cleanup various cosmetic whitespace issues
Cleans up TIPC's source code to eliminate deviations from generally accepted coding conventions relating to leading/trailing white space and white space around commas, braces, cases, and sizeof. These changes are purely cosmetic and do not alter the operation of TIPC in any way. Signed-off-by: Allan Stephens <Allan.Stephens@windriver.com> Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent 25860c3 commit 0e65967

19 files changed

Lines changed: 124 additions & 133 deletions

File tree

‎include/linux/tipc.h‎

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
* include/linux/tipc.h: Include file for TIPC socket interface
3-
*
3+
*
44
* Copyright (c) 2003-2006, Ericsson AB
55
* Copyright (c) 2005, Wind River Systems
66
* All rights reserved.
@@ -42,7 +42,7 @@
4242
/*
4343
* TIPC addressing primitives
4444
*/
45-
45+
4646
struct tipc_portid {
4747
__u32 ref;
4848
__u32 node;
@@ -89,7 +89,7 @@ static inline unsigned int tipc_node(__u32 addr)
8989
#define TIPC_TOP_SRV 1 /* topology service name type */
9090
#define TIPC_RESERVED_TYPES 64 /* lowest user-publishable name type */
9191

92-
/*
92+
/*
9393
* Publication scopes when binding port names and port name sequences
9494
*/
9595

@@ -112,7 +112,7 @@ static inline unsigned int tipc_node(__u32 addr)
112112
#define TIPC_HIGH_IMPORTANCE 2
113113
#define TIPC_CRITICAL_IMPORTANCE 3
114114

115-
/*
115+
/*
116116
* Msg rejection/connection shutdown reasons
117117
*/
118118

@@ -127,22 +127,22 @@ static inline unsigned int tipc_node(__u32 addr)
127127
* TIPC topology subscription service definitions
128128
*/
129129

130-
#define TIPC_SUB_PORTS 0x01 /* filter for port availability */
131-
#define TIPC_SUB_SERVICE 0x02 /* filter for service availability */
132-
#define TIPC_SUB_CANCEL 0x04 /* cancel a subscription */
130+
#define TIPC_SUB_PORTS 0x01 /* filter for port availability */
131+
#define TIPC_SUB_SERVICE 0x02 /* filter for service availability */
132+
#define TIPC_SUB_CANCEL 0x04 /* cancel a subscription */
133133
#if 0
134134
/* The following filter options are not currently implemented */
135135
#define TIPC_SUB_NO_BIND_EVTS 0x04 /* filter out "publish" events */
136136
#define TIPC_SUB_NO_UNBIND_EVTS 0x08 /* filter out "withdraw" events */
137137
#define TIPC_SUB_SINGLE_EVT 0x10 /* expire after first event */
138138
#endif
139139

140-
#define TIPC_WAIT_FOREVER ~0 /* timeout for permanent subscription */
140+
#define TIPC_WAIT_FOREVER (~0) /* timeout for permanent subscription */
141141

142142
struct tipc_subscr {
143143
struct tipc_name_seq seq; /* name sequence of interest */
144144
__u32 timeout; /* subscription duration (in ms) */
145-
__u32 filter; /* bitmask of filter options */
145+
__u32 filter; /* bitmask of filter options */
146146
char usr_handle[8]; /* available for subscriber use */
147147
};
148148

‎include/linux/tipc_config.h‎

Lines changed: 29 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
* include/linux/tipc_config.h: Include file for TIPC configuration interface
3-
*
3+
*
44
* Copyright (c) 2003-2006, Ericsson AB
55
* Copyright (c) 2005-2007, Wind River Systems
66
* All rights reserved.
@@ -54,19 +54,19 @@
5454
* which specify parameters or results for the operation.
5555
*
5656
* For many operations, the request and reply messages have a fixed number
57-
* of TLVs (usually zero or one); however, some reply messages may return
57+
* of TLVs (usually zero or one); however, some reply messages may return
5858
* a variable number of TLVs. A failed request is denoted by the presence
5959
* of an "error string" TLV in the reply message instead of the TLV(s) the
6060
* reply should contain if the request succeeds.
6161
*/
62-
63-
/*
62+
63+
/*
6464
* Public commands:
6565
* May be issued by any process.
66-
* Accepted by own node, or by remote node only if remote management enabled.
66+
* Accepted by own node, or by remote node only if remote management enabled.
6767
*/
68-
69-
#define TIPC_CMD_NOOP 0x0000 /* tx none, rx none */
68+
69+
#define TIPC_CMD_NOOP 0x0000 /* tx none, rx none */
7070
#define TIPC_CMD_GET_NODES 0x0001 /* tx net_addr, rx node_info(s) */
7171
#define TIPC_CMD_GET_MEDIA_NAMES 0x0002 /* tx none, rx media_name(s) */
7272
#define TIPC_CMD_GET_BEARER_NAMES 0x0003 /* tx none, rx bearer_name(s) */
@@ -83,11 +83,11 @@
8383
#define TIPC_CMD_GET_LINK_PEER 0x000D /* tx link_name, rx ? */
8484
#endif
8585

86-
/*
86+
/*
8787
* Protected commands:
8888
* May only be issued by "network administration capable" process.
8989
* Accepted by own node, or by remote node only if remote management enabled
90-
* and this node is zone manager.
90+
* and this node is zone manager.
9191
*/
9292

9393
#define TIPC_CMD_GET_REMOTE_MNG 0x4003 /* tx none, rx unsigned */
@@ -116,10 +116,10 @@
116116
#define TIPC_CMD_UNBLOCK_LINK 0x4106 /* tx link_name, rx none */
117117
#endif
118118

119-
/*
119+
/*
120120
* Private commands:
121121
* May only be issued by "network administration capable" process.
122-
* Accepted by own node only; cannot be used on a remote node.
122+
* Accepted by own node only; cannot be used on a remote node.
123123
*/
124124

125125
#define TIPC_CMD_SET_NODE_ADDR 0x8001 /* tx net_addr, rx none */
@@ -156,20 +156,20 @@
156156
#define TIPC_TLV_ULTRA_STRING 5 /* char[32768] (max) */
157157

158158
#define TIPC_TLV_ERROR_STRING 16 /* char[128] containing "error code" */
159-
#define TIPC_TLV_NET_ADDR 17 /* 32-bit integer denoting <Z.C.N> */
159+
#define TIPC_TLV_NET_ADDR 17 /* 32-bit integer denoting <Z.C.N> */
160160
#define TIPC_TLV_MEDIA_NAME 18 /* char[TIPC_MAX_MEDIA_NAME] */
161161
#define TIPC_TLV_BEARER_NAME 19 /* char[TIPC_MAX_BEARER_NAME] */
162162
#define TIPC_TLV_LINK_NAME 20 /* char[TIPC_MAX_LINK_NAME] */
163163
#define TIPC_TLV_NODE_INFO 21 /* struct tipc_node_info */
164164
#define TIPC_TLV_LINK_INFO 22 /* struct tipc_link_info */
165-
#define TIPC_TLV_BEARER_CONFIG 23 /* struct tipc_bearer_config */
166-
#define TIPC_TLV_LINK_CONFIG 24 /* struct tipc_link_config */
165+
#define TIPC_TLV_BEARER_CONFIG 23 /* struct tipc_bearer_config */
166+
#define TIPC_TLV_LINK_CONFIG 24 /* struct tipc_link_config */
167167
#define TIPC_TLV_NAME_TBL_QUERY 25 /* struct tipc_name_table_query */
168-
#define TIPC_TLV_PORT_REF 26 /* 32-bit port reference */
168+
#define TIPC_TLV_PORT_REF 26 /* 32-bit port reference */
169169

170170
/*
171171
* Maximum sizes of TIPC bearer-related names (including terminating NUL)
172-
*/
172+
*/
173173

174174
#define TIPC_MAX_MEDIA_NAME 16 /* format = media */
175175
#define TIPC_MAX_IF_NAME 16 /* format = interface */
@@ -234,7 +234,7 @@ struct tipc_name_table_query {
234234
};
235235

236236
/*
237-
* The error string TLV is a null-terminated string describing the cause
237+
* The error string TLV is a null-terminated string describing the cause
238238
* of the request failure. To simplify error processing (and to save space)
239239
* the first character of the string can be a special error code character
240240
* (lying by the range 0x80 to 0xFF) which represents a pre-defined reason.
@@ -258,7 +258,7 @@ struct tipc_link_create {
258258

259259
/*
260260
* A TLV consists of a descriptor, followed by the TLV value.
261-
* TLV descriptor fields are stored in network byte order;
261+
* TLV descriptor fields are stored in network byte order;
262262
* TLV values must also be stored in network byte order (where applicable).
263263
* TLV descriptors must be aligned to addresses which are multiple of 4,
264264
* so up to 3 bytes of padding may exist at the end of the TLV value area.
@@ -294,7 +294,7 @@ static inline int TLV_OK(const void *tlv, __u16 space)
294294

295295
static inline int TLV_CHECK(const void *tlv, __u16 space, __u16 exp_type)
296296
{
297-
return TLV_OK(tlv, space) &&
297+
return TLV_OK(tlv, space) &&
298298
(ntohs(((struct tlv_desc *)tlv)->tlv_type) == exp_type);
299299
}
300300

@@ -313,7 +313,7 @@ static inline int TLV_SET(void *tlv, __u16 type, void *data, __u16 len)
313313
}
314314

315315
/*
316-
* A TLV list descriptor simplifies processing of messages
316+
* A TLV list descriptor simplifies processing of messages
317317
* containing multiple TLVs.
318318
*/
319319

@@ -322,15 +322,15 @@ struct tlv_list_desc {
322322
__u32 tlv_space; /* # bytes from curr TLV to list end */
323323
};
324324

325-
static inline void TLV_LIST_INIT(struct tlv_list_desc *list,
325+
static inline void TLV_LIST_INIT(struct tlv_list_desc *list,
326326
void *data, __u32 space)
327327
{
328328
list->tlv_ptr = (struct tlv_desc *)data;
329329
list->tlv_space = space;
330330
}
331-
331+
332332
static inline int TLV_LIST_EMPTY(struct tlv_list_desc *list)
333-
{
333+
{
334334
return (list->tlv_space == 0);
335335
}
336336

@@ -348,7 +348,7 @@ static inline void TLV_LIST_STEP(struct tlv_list_desc *list)
348348
{
349349
__u16 tlv_space = TLV_ALIGN(ntohs(list->tlv_ptr->tlv_len));
350350

351-
list->tlv_ptr = (struct tlv_desc *)((char *)list->tlv_ptr + tlv_space);
351+
list->tlv_ptr = (struct tlv_desc *)((char *)list->tlv_ptr + tlv_space);
352352
list->tlv_space -= tlv_space;
353353
}
354354

@@ -372,15 +372,14 @@ struct tipc_genlmsghdr {
372372
#define TIPC_GENL_HDRLEN NLMSG_ALIGN(sizeof(struct tipc_genlmsghdr))
373373

374374
/*
375-
* Configuration messages exchanged via TIPC sockets use the TIPC configuration
376-
* message header, which is defined below. This structure is analogous
377-
* to the Netlink message header, but fields are stored in network byte order
378-
* and no padding is permitted between the header and the message data
375+
* Configuration messages exchanged via TIPC sockets use the TIPC configuration
376+
* message header, which is defined below. This structure is analogous
377+
* to the Netlink message header, but fields are stored in network byte order
378+
* and no padding is permitted between the header and the message data
379379
* that follows.
380380
*/
381381

382-
struct tipc_cfg_msg_hdr
383-
{
382+
struct tipc_cfg_msg_hdr {
384383
__be32 tcm_len; /* Message length (including header) */
385384
__be16 tcm_type; /* Command type */
386385
__be16 tcm_flags; /* Additional flags */

‎net/tipc/Kconfig‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ config TIPC_PORTS
5050
Specifies how many ports can be supported by a node.
5151
Can range from 127 to 65535 ports; default is 8191.
5252

53-
Setting this to a smaller value saves some memory,
53+
Setting this to a smaller value saves some memory,
5454
setting it to higher allows for more ports.
5555

5656
config TIPC_LOG

‎net/tipc/bcast.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -428,7 +428,7 @@ void tipc_bclink_recv_pkt(struct sk_buff *buf)
428428
static int rx_count = 0;
429429
#endif
430430
struct tipc_msg *msg = buf_msg(buf);
431-
struct tipc_node* node = tipc_node_find(msg_prevnode(msg));
431+
struct tipc_node *node = tipc_node_find(msg_prevnode(msg));
432432
u32 next_in;
433433
u32 seqno;
434434
struct sk_buff *deferred;

‎net/tipc/config.c‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -322,8 +322,7 @@ struct sk_buff *tipc_cfg_do_cmd(u32 orig_node, u16 cmd, const void *request_area
322322
} else if (!tipc_remote_management) {
323323
rep_tlv_buf = tipc_cfg_reply_error_string(TIPC_CFG_NO_REMOTE);
324324
goto exit;
325-
}
326-
else if (cmd >= 0x4000) {
325+
} else if (cmd >= 0x4000) {
327326
u32 domain = 0;
328327

329328
if ((tipc_nametbl_translate(TIPC_ZM_SRV, 0, &domain) == 0) ||

‎net/tipc/discover.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ void tipc_disc_recv_msg(struct sk_buff *buf, struct bearer *b_ptr)
130130
u32 net_id = msg_bc_netid(msg);
131131
u32 type = msg_type(msg);
132132

133-
msg_get_media_addr(msg,&media_addr);
133+
msg_get_media_addr(msg, &media_addr);
134134
buf_discard(buf);
135135

136136
if (net_id != tipc_net_id)

‎net/tipc/eth_media.c‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ static int enable_bearer(struct tipc_bearer *tb_ptr)
144144

145145
/* Find device with specified name */
146146

147-
for_each_netdev(&init_net, pdev){
147+
for_each_netdev(&init_net, pdev) {
148148
if (!strncmp(pdev->name, driver_name, IFNAMSIZ)) {
149149
dev = pdev;
150150
break;
@@ -155,7 +155,8 @@ static int enable_bearer(struct tipc_bearer *tb_ptr)
155155

156156
/* Find Ethernet bearer for device (or create one) */
157157

158-
for (;(eb_ptr != stop) && eb_ptr->dev && (eb_ptr->dev != dev); eb_ptr++);
158+
while ((eb_ptr != stop) && eb_ptr->dev && (eb_ptr->dev != dev))
159+
eb_ptr++;
159160
if (eb_ptr == stop)
160161
return -EDQUOT;
161162
if (!eb_ptr->dev) {

‎net/tipc/link.c‎

Lines changed: 14 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -977,8 +977,7 @@ static int link_send_buf_fast(struct link *l_ptr, struct sk_buff *buf,
977977
l_ptr->next_out = buf;
978978
return res;
979979
}
980-
}
981-
else
980+
} else
982981
*used_max_pkt = l_ptr->max_pkt;
983982
}
984983
return tipc_link_send_buf(l_ptr, buf); /* All other cases */
@@ -1132,10 +1131,10 @@ static int link_send_sections_long(struct port *sender,
11321131
struct tipc_node *node;
11331132
struct tipc_msg *hdr = &sender->publ.phdr;
11341133
u32 dsz = msg_data_sz(hdr);
1135-
u32 max_pkt,fragm_sz,rest;
1134+
u32 max_pkt, fragm_sz, rest;
11361135
struct tipc_msg fragm_hdr;
1137-
struct sk_buff *buf,*buf_chain,*prev;
1138-
u32 fragm_crs,fragm_rest,hsz,sect_rest;
1136+
struct sk_buff *buf, *buf_chain, *prev;
1137+
u32 fragm_crs, fragm_rest, hsz, sect_rest;
11391138
const unchar *sect_crs;
11401139
int curr_sect;
11411140
u32 fragm_no;
@@ -1212,7 +1211,7 @@ static int link_send_sections_long(struct port *sender,
12121211
/* Initiate new fragment: */
12131212
if (rest <= fragm_sz) {
12141213
fragm_sz = rest;
1215-
msg_set_type(&fragm_hdr,LAST_FRAGMENT);
1214+
msg_set_type(&fragm_hdr, LAST_FRAGMENT);
12161215
} else {
12171216
msg_set_type(&fragm_hdr, FRAGMENT);
12181217
}
@@ -1229,8 +1228,7 @@ static int link_send_sections_long(struct port *sender,
12291228
fragm_crs = INT_H_SIZE;
12301229
fragm_rest = fragm_sz;
12311230
}
1232-
}
1233-
while (rest > 0);
1231+
} while (rest > 0);
12341232

12351233
/*
12361234
* Now we have a buffer chain. Select a link and check
@@ -1333,7 +1331,7 @@ u32 tipc_link_push_packet(struct link *l_ptr)
13331331
buf = l_ptr->proto_msg_queue;
13341332
if (buf) {
13351333
msg_set_ack(buf_msg(buf), mod(l_ptr->next_in_no - 1));
1336-
msg_set_bcast_ack(buf_msg(buf),l_ptr->owner->bclink.last_in);
1334+
msg_set_bcast_ack(buf_msg(buf), l_ptr->owner->bclink.last_in);
13371335
if (tipc_bearer_send(l_ptr->b_ptr, buf, &l_ptr->media_addr)) {
13381336
l_ptr->unacked_window = 0;
13391337
buf_discard(buf);
@@ -1847,8 +1845,7 @@ u32 tipc_link_defer_pkt(struct sk_buff **head,
18471845
}
18481846
prev = crs;
18491847
crs = crs->next;
1850-
}
1851-
while (crs);
1848+
} while (crs);
18521849

18531850
/* Message is a duplicate of an existing message */
18541851

@@ -2215,11 +2212,11 @@ void tipc_link_changeover(struct link *l_ptr)
22152212

22162213
if ((msg_user(msg) == MSG_BUNDLER) && split_bundles) {
22172214
struct tipc_msg *m = msg_get_wrapped(msg);
2218-
unchar* pos = (unchar*)m;
2215+
unchar *pos = (unchar *)m;
22192216

22202217
msgcount = msg_msgcnt(msg);
22212218
while (msgcount--) {
2222-
msg_set_seqno(m,msg_seqno(msg));
2219+
msg_set_seqno(m, msg_seqno(msg));
22232220
tipc_link_tunnel(l_ptr, &tunnel_hdr, m,
22242221
msg_link_selector(m));
22252222
pos += align(msg_size(m));
@@ -2321,7 +2318,7 @@ static int link_recv_changeover_msg(struct link **l_ptr,
23212318
if (msg_typ == DUPLICATE_MSG) {
23222319
if (less(msg_seqno(msg), mod(dest_link->next_in_no)))
23232320
goto exit;
2324-
*buf = buf_extract(tunnel_buf,INT_H_SIZE);
2321+
*buf = buf_extract(tunnel_buf, INT_H_SIZE);
23252322
if (*buf == NULL) {
23262323
warn("Link changeover error, duplicate msg dropped\n");
23272324
goto exit;
@@ -2552,8 +2549,8 @@ int tipc_link_recv_fragment(struct sk_buff **pending, struct sk_buff **fb,
25522549
/* Prepare buffer for subsequent fragments. */
25532550

25542551
set_long_msg_seqno(pbuf, long_msg_seq_no);
2555-
set_fragm_size(pbuf,fragm_sz);
2556-
set_expected_frags(pbuf,exp_fragm_cnt - 1);
2552+
set_fragm_size(pbuf, fragm_sz);
2553+
set_expected_frags(pbuf, exp_fragm_cnt - 1);
25572554
} else {
25582555
warn("Link unable to reassemble fragmented message\n");
25592556
}
@@ -2580,7 +2577,7 @@ int tipc_link_recv_fragment(struct sk_buff **pending, struct sk_buff **fb,
25802577
*m = buf_msg(pbuf);
25812578
return 1;
25822579
}
2583-
set_expected_frags(pbuf,exp_frags);
2580+
set_expected_frags(pbuf, exp_frags);
25842581
return 0;
25852582
}
25862583
buf_discard(fbuf);

0 commit comments

Comments
 (0)