Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

tipc: rename media/msg related definitions

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 <erik.hugne@ericsson.com>
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by

Erik Hugne and committed by
David S. Miller
91e2eb56 afaa3f65

+6 -6
+2 -2
net/tipc/bearer.h
··· 50 50 * - the field's actual content and length is defined per media 51 51 * - remaining unused bytes in the field are set to zero 52 52 */ 53 - #define TIPC_MEDIA_ADDR_SIZE 32 53 + #define TIPC_MEDIA_INFO_SIZE 32 54 54 #define TIPC_MEDIA_TYPE_OFFSET 3 55 55 56 56 /* ··· 76 76 * @broadcast: non-zero if address is a broadcast address 77 77 */ 78 78 struct tipc_media_addr { 79 - u8 value[TIPC_MEDIA_ADDR_SIZE]; 79 + u8 value[TIPC_MEDIA_INFO_SIZE]; 80 80 u8 media_id; 81 81 u8 broadcast; 82 82 };
+1 -1
net/tipc/eth_media.c
··· 53 53 /* Convert from media address format to discovery message addr format */ 54 54 static int tipc_eth_addr2msg(char *msg, struct tipc_media_addr *addr) 55 55 { 56 - memset(msg, 0, TIPC_MEDIA_ADDR_SIZE); 56 + memset(msg, 0, TIPC_MEDIA_INFO_SIZE); 57 57 msg[TIPC_MEDIA_TYPE_OFFSET] = TIPC_MEDIA_TYPE_ETH; 58 58 memcpy(msg + ETH_ADDR_OFFSET, addr->value, ETH_ALEN); 59 59 return 0;
+1 -1
net/tipc/ib_media.c
··· 57 57 /* Convert from media address format to discovery message addr format */ 58 58 static int tipc_ib_addr2msg(char *msg, struct tipc_media_addr *addr) 59 59 { 60 - memset(msg, 0, TIPC_MEDIA_ADDR_SIZE); 60 + memset(msg, 0, TIPC_MEDIA_INFO_SIZE); 61 61 memcpy(msg, addr->value, INFINIBAND_ALEN); 62 62 return 0; 63 63 }
+2 -2
net/tipc/msg.h
··· 76 76 77 77 #define MAX_MSG_SIZE (MAX_H_SIZE + TIPC_MAX_USER_MSG_SIZE) 78 78 79 - #define TIPC_MEDIA_ADDR_OFFSET 5 79 + #define TIPC_MEDIA_INFO_OFFSET 5 80 80 81 81 /** 82 82 * TIPC message buffer code ··· 688 688 689 689 static inline char *msg_media_addr(struct tipc_msg *m) 690 690 { 691 - return (char *)&m->hdr[TIPC_MEDIA_ADDR_OFFSET]; 691 + return (char *)&m->hdr[TIPC_MEDIA_INFO_OFFSET]; 692 692 } 693 693 694 694 /*