Skip to content

Commit

Permalink
tipc: rename media/msg related definitions
Browse files Browse the repository at this point in the history
The TIPC_MEDIA_ADDR_SIZE and TIPC_MEDIA_ADDR_OFFSET names
are misleading, as they actually define the size and offset of
the whole media info field and not the address part. This patch
does not have any functional changes.

Signed-off-by: Erik Hugne <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
Erik Hugne authored and davem330 committed Feb 27, 2015
1 parent afaa3f6 commit 91e2eb5
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions net/tipc/bearer.h
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
* - the field's actual content and length is defined per media
* - remaining unused bytes in the field are set to zero
*/
#define TIPC_MEDIA_ADDR_SIZE 32
#define TIPC_MEDIA_INFO_SIZE 32
#define TIPC_MEDIA_TYPE_OFFSET 3

/*
Expand All @@ -76,7 +76,7 @@ struct tipc_node_map {
* @broadcast: non-zero if address is a broadcast address
*/
struct tipc_media_addr {
u8 value[TIPC_MEDIA_ADDR_SIZE];
u8 value[TIPC_MEDIA_INFO_SIZE];
u8 media_id;
u8 broadcast;
};
Expand Down
2 changes: 1 addition & 1 deletion net/tipc/eth_media.c
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ static int tipc_eth_addr2str(struct tipc_media_addr *addr,
/* Convert from media address format to discovery message addr format */
static int tipc_eth_addr2msg(char *msg, struct tipc_media_addr *addr)
{
memset(msg, 0, TIPC_MEDIA_ADDR_SIZE);
memset(msg, 0, TIPC_MEDIA_INFO_SIZE);
msg[TIPC_MEDIA_TYPE_OFFSET] = TIPC_MEDIA_TYPE_ETH;
memcpy(msg + ETH_ADDR_OFFSET, addr->value, ETH_ALEN);
return 0;
Expand Down
2 changes: 1 addition & 1 deletion net/tipc/ib_media.c
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ static int tipc_ib_addr2str(struct tipc_media_addr *a, char *str_buf,
/* Convert from media address format to discovery message addr format */
static int tipc_ib_addr2msg(char *msg, struct tipc_media_addr *addr)
{
memset(msg, 0, TIPC_MEDIA_ADDR_SIZE);
memset(msg, 0, TIPC_MEDIA_INFO_SIZE);
memcpy(msg, addr->value, INFINIBAND_ALEN);
return 0;
}
Expand Down
4 changes: 2 additions & 2 deletions net/tipc/msg.h
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ struct plist;

#define MAX_MSG_SIZE (MAX_H_SIZE + TIPC_MAX_USER_MSG_SIZE)

#define TIPC_MEDIA_ADDR_OFFSET 5
#define TIPC_MEDIA_INFO_OFFSET 5

/**
* TIPC message buffer code
Expand Down Expand Up @@ -688,7 +688,7 @@ static inline void msg_set_redundant_link(struct tipc_msg *m, u32 r)

static inline char *msg_media_addr(struct tipc_msg *m)
{
return (char *)&m->hdr[TIPC_MEDIA_ADDR_OFFSET];
return (char *)&m->hdr[TIPC_MEDIA_INFO_OFFSET];
}

/*
Expand Down

0 comments on commit 91e2eb5

Please sign in to comment.