Skip to content

Commit

Permalink
tipc: cleanup various cosmetic whitespace issues
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Allan Stephens authored and David S. Miller committed Jan 1, 2011
1 parent 25860c3 commit 0e65967
Show file tree
Hide file tree
Showing 19 changed files with 124 additions and 133 deletions.
18 changes: 9 additions & 9 deletions include/linux/tipc.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* include/linux/tipc.h: Include file for TIPC socket interface
*
*
* Copyright (c) 2003-2006, Ericsson AB
* Copyright (c) 2005, Wind River Systems
* All rights reserved.
Expand Down Expand Up @@ -42,7 +42,7 @@
/*
* TIPC addressing primitives
*/

struct tipc_portid {
__u32 ref;
__u32 node;
Expand Down Expand Up @@ -89,7 +89,7 @@ static inline unsigned int tipc_node(__u32 addr)
#define TIPC_TOP_SRV 1 /* topology service name type */
#define TIPC_RESERVED_TYPES 64 /* lowest user-publishable name type */

/*
/*
* Publication scopes when binding port names and port name sequences
*/

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

/*
/*
* Msg rejection/connection shutdown reasons
*/

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

#define TIPC_SUB_PORTS 0x01 /* filter for port availability */
#define TIPC_SUB_SERVICE 0x02 /* filter for service availability */
#define TIPC_SUB_CANCEL 0x04 /* cancel a subscription */
#define TIPC_SUB_PORTS 0x01 /* filter for port availability */
#define TIPC_SUB_SERVICE 0x02 /* filter for service availability */
#define TIPC_SUB_CANCEL 0x04 /* cancel a subscription */
#if 0
/* The following filter options are not currently implemented */
#define TIPC_SUB_NO_BIND_EVTS 0x04 /* filter out "publish" events */
#define TIPC_SUB_NO_UNBIND_EVTS 0x08 /* filter out "withdraw" events */
#define TIPC_SUB_SINGLE_EVT 0x10 /* expire after first event */
#endif

#define TIPC_WAIT_FOREVER ~0 /* timeout for permanent subscription */
#define TIPC_WAIT_FOREVER (~0) /* timeout for permanent subscription */

struct tipc_subscr {
struct tipc_name_seq seq; /* name sequence of interest */
__u32 timeout; /* subscription duration (in ms) */
__u32 filter; /* bitmask of filter options */
__u32 filter; /* bitmask of filter options */
char usr_handle[8]; /* available for subscriber use */
};

Expand Down
59 changes: 29 additions & 30 deletions include/linux/tipc_config.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* include/linux/tipc_config.h: Include file for TIPC configuration interface
*
*
* Copyright (c) 2003-2006, Ericsson AB
* Copyright (c) 2005-2007, Wind River Systems
* All rights reserved.
Expand Down Expand Up @@ -54,19 +54,19 @@
* which specify parameters or results for the operation.
*
* For many operations, the request and reply messages have a fixed number
* of TLVs (usually zero or one); however, some reply messages may return
* of TLVs (usually zero or one); however, some reply messages may return
* a variable number of TLVs. A failed request is denoted by the presence
* of an "error string" TLV in the reply message instead of the TLV(s) the
* reply should contain if the request succeeds.
*/
/*

/*
* Public commands:
* May be issued by any process.
* Accepted by own node, or by remote node only if remote management enabled.
* Accepted by own node, or by remote node only if remote management enabled.
*/
#define TIPC_CMD_NOOP 0x0000 /* tx none, rx none */

#define TIPC_CMD_NOOP 0x0000 /* tx none, rx none */
#define TIPC_CMD_GET_NODES 0x0001 /* tx net_addr, rx node_info(s) */
#define TIPC_CMD_GET_MEDIA_NAMES 0x0002 /* tx none, rx media_name(s) */
#define TIPC_CMD_GET_BEARER_NAMES 0x0003 /* tx none, rx bearer_name(s) */
Expand All @@ -83,11 +83,11 @@
#define TIPC_CMD_GET_LINK_PEER 0x000D /* tx link_name, rx ? */
#endif

/*
/*
* Protected commands:
* May only be issued by "network administration capable" process.
* Accepted by own node, or by remote node only if remote management enabled
* and this node is zone manager.
* and this node is zone manager.
*/

#define TIPC_CMD_GET_REMOTE_MNG 0x4003 /* tx none, rx unsigned */
Expand Down Expand Up @@ -116,10 +116,10 @@
#define TIPC_CMD_UNBLOCK_LINK 0x4106 /* tx link_name, rx none */
#endif

/*
/*
* Private commands:
* May only be issued by "network administration capable" process.
* Accepted by own node only; cannot be used on a remote node.
* Accepted by own node only; cannot be used on a remote node.
*/

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

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

/*
* Maximum sizes of TIPC bearer-related names (including terminating NUL)
*/
*/

#define TIPC_MAX_MEDIA_NAME 16 /* format = media */
#define TIPC_MAX_IF_NAME 16 /* format = interface */
Expand Down Expand Up @@ -234,7 +234,7 @@ struct tipc_name_table_query {
};

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

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

static inline int TLV_CHECK(const void *tlv, __u16 space, __u16 exp_type)
{
return TLV_OK(tlv, space) &&
return TLV_OK(tlv, space) &&
(ntohs(((struct tlv_desc *)tlv)->tlv_type) == exp_type);
}

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

/*
* A TLV list descriptor simplifies processing of messages
* A TLV list descriptor simplifies processing of messages
* containing multiple TLVs.
*/

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

static inline void TLV_LIST_INIT(struct tlv_list_desc *list,
static inline void TLV_LIST_INIT(struct tlv_list_desc *list,
void *data, __u32 space)
{
list->tlv_ptr = (struct tlv_desc *)data;
list->tlv_space = space;
}

static inline int TLV_LIST_EMPTY(struct tlv_list_desc *list)
{
{
return (list->tlv_space == 0);
}

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

list->tlv_ptr = (struct tlv_desc *)((char *)list->tlv_ptr + tlv_space);
list->tlv_ptr = (struct tlv_desc *)((char *)list->tlv_ptr + tlv_space);
list->tlv_space -= tlv_space;
}

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

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

struct tipc_cfg_msg_hdr
{
struct tipc_cfg_msg_hdr {
__be32 tcm_len; /* Message length (including header) */
__be16 tcm_type; /* Command type */
__be16 tcm_flags; /* Additional flags */
Expand Down
2 changes: 1 addition & 1 deletion net/tipc/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ config TIPC_PORTS
Specifies how many ports can be supported by a node.
Can range from 127 to 65535 ports; default is 8191.

Setting this to a smaller value saves some memory,
Setting this to a smaller value saves some memory,
setting it to higher allows for more ports.

config TIPC_LOG
Expand Down
2 changes: 1 addition & 1 deletion net/tipc/bcast.c
Original file line number Diff line number Diff line change
Expand Up @@ -428,7 +428,7 @@ void tipc_bclink_recv_pkt(struct sk_buff *buf)
static int rx_count = 0;
#endif
struct tipc_msg *msg = buf_msg(buf);
struct tipc_node* node = tipc_node_find(msg_prevnode(msg));
struct tipc_node *node = tipc_node_find(msg_prevnode(msg));
u32 next_in;
u32 seqno;
struct sk_buff *deferred;
Expand Down
3 changes: 1 addition & 2 deletions net/tipc/config.c
Original file line number Diff line number Diff line change
Expand Up @@ -322,8 +322,7 @@ struct sk_buff *tipc_cfg_do_cmd(u32 orig_node, u16 cmd, const void *request_area
} else if (!tipc_remote_management) {
rep_tlv_buf = tipc_cfg_reply_error_string(TIPC_CFG_NO_REMOTE);
goto exit;
}
else if (cmd >= 0x4000) {
} else if (cmd >= 0x4000) {
u32 domain = 0;

if ((tipc_nametbl_translate(TIPC_ZM_SRV, 0, &domain) == 0) ||
Expand Down
2 changes: 1 addition & 1 deletion net/tipc/discover.c
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ void tipc_disc_recv_msg(struct sk_buff *buf, struct bearer *b_ptr)
u32 net_id = msg_bc_netid(msg);
u32 type = msg_type(msg);

msg_get_media_addr(msg,&media_addr);
msg_get_media_addr(msg, &media_addr);
buf_discard(buf);

if (net_id != tipc_net_id)
Expand Down
5 changes: 3 additions & 2 deletions net/tipc/eth_media.c
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ static int enable_bearer(struct tipc_bearer *tb_ptr)

/* Find device with specified name */

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

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

for (;(eb_ptr != stop) && eb_ptr->dev && (eb_ptr->dev != dev); eb_ptr++);
while ((eb_ptr != stop) && eb_ptr->dev && (eb_ptr->dev != dev))
eb_ptr++;
if (eb_ptr == stop)
return -EDQUOT;
if (!eb_ptr->dev) {
Expand Down
31 changes: 14 additions & 17 deletions net/tipc/link.c
Original file line number Diff line number Diff line change
Expand Up @@ -977,8 +977,7 @@ static int link_send_buf_fast(struct link *l_ptr, struct sk_buff *buf,
l_ptr->next_out = buf;
return res;
}
}
else
} else
*used_max_pkt = l_ptr->max_pkt;
}
return tipc_link_send_buf(l_ptr, buf); /* All other cases */
Expand Down Expand Up @@ -1132,10 +1131,10 @@ static int link_send_sections_long(struct port *sender,
struct tipc_node *node;
struct tipc_msg *hdr = &sender->publ.phdr;
u32 dsz = msg_data_sz(hdr);
u32 max_pkt,fragm_sz,rest;
u32 max_pkt, fragm_sz, rest;
struct tipc_msg fragm_hdr;
struct sk_buff *buf,*buf_chain,*prev;
u32 fragm_crs,fragm_rest,hsz,sect_rest;
struct sk_buff *buf, *buf_chain, *prev;
u32 fragm_crs, fragm_rest, hsz, sect_rest;
const unchar *sect_crs;
int curr_sect;
u32 fragm_no;
Expand Down Expand Up @@ -1212,7 +1211,7 @@ static int link_send_sections_long(struct port *sender,
/* Initiate new fragment: */
if (rest <= fragm_sz) {
fragm_sz = rest;
msg_set_type(&fragm_hdr,LAST_FRAGMENT);
msg_set_type(&fragm_hdr, LAST_FRAGMENT);
} else {
msg_set_type(&fragm_hdr, FRAGMENT);
}
Expand All @@ -1229,8 +1228,7 @@ static int link_send_sections_long(struct port *sender,
fragm_crs = INT_H_SIZE;
fragm_rest = fragm_sz;
}
}
while (rest > 0);
} while (rest > 0);

/*
* Now we have a buffer chain. Select a link and check
Expand Down Expand Up @@ -1333,7 +1331,7 @@ u32 tipc_link_push_packet(struct link *l_ptr)
buf = l_ptr->proto_msg_queue;
if (buf) {
msg_set_ack(buf_msg(buf), mod(l_ptr->next_in_no - 1));
msg_set_bcast_ack(buf_msg(buf),l_ptr->owner->bclink.last_in);
msg_set_bcast_ack(buf_msg(buf), l_ptr->owner->bclink.last_in);
if (tipc_bearer_send(l_ptr->b_ptr, buf, &l_ptr->media_addr)) {
l_ptr->unacked_window = 0;
buf_discard(buf);
Expand Down Expand Up @@ -1847,8 +1845,7 @@ u32 tipc_link_defer_pkt(struct sk_buff **head,
}
prev = crs;
crs = crs->next;
}
while (crs);
} while (crs);

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

Expand Down Expand Up @@ -2215,11 +2212,11 @@ void tipc_link_changeover(struct link *l_ptr)

if ((msg_user(msg) == MSG_BUNDLER) && split_bundles) {
struct tipc_msg *m = msg_get_wrapped(msg);
unchar* pos = (unchar*)m;
unchar *pos = (unchar *)m;

msgcount = msg_msgcnt(msg);
while (msgcount--) {
msg_set_seqno(m,msg_seqno(msg));
msg_set_seqno(m, msg_seqno(msg));
tipc_link_tunnel(l_ptr, &tunnel_hdr, m,
msg_link_selector(m));
pos += align(msg_size(m));
Expand Down Expand Up @@ -2321,7 +2318,7 @@ static int link_recv_changeover_msg(struct link **l_ptr,
if (msg_typ == DUPLICATE_MSG) {
if (less(msg_seqno(msg), mod(dest_link->next_in_no)))
goto exit;
*buf = buf_extract(tunnel_buf,INT_H_SIZE);
*buf = buf_extract(tunnel_buf, INT_H_SIZE);
if (*buf == NULL) {
warn("Link changeover error, duplicate msg dropped\n");
goto exit;
Expand Down Expand Up @@ -2552,8 +2549,8 @@ int tipc_link_recv_fragment(struct sk_buff **pending, struct sk_buff **fb,
/* Prepare buffer for subsequent fragments. */

set_long_msg_seqno(pbuf, long_msg_seq_no);
set_fragm_size(pbuf,fragm_sz);
set_expected_frags(pbuf,exp_fragm_cnt - 1);
set_fragm_size(pbuf, fragm_sz);
set_expected_frags(pbuf, exp_fragm_cnt - 1);
} else {
warn("Link unable to reassemble fragmented message\n");
}
Expand All @@ -2580,7 +2577,7 @@ int tipc_link_recv_fragment(struct sk_buff **pending, struct sk_buff **fb,
*m = buf_msg(pbuf);
return 1;
}
set_expected_frags(pbuf,exp_frags);
set_expected_frags(pbuf, exp_frags);
return 0;
}
buf_discard(fbuf);
Expand Down
Loading

0 comments on commit 0e65967

Please sign in to comment.