summaryrefslogtreecommitdiff
path: root/net/tipc
diff options
context:
space:
mode:
authorZheng Yongjun <zhengyongjun3@huawei.com>2020-12-29 21:49:04 +0800
committerDavid S. Miller <davem@davemloft.net>2021-01-05 15:43:41 -0800
commit520ec34385d57ae18ec034ddc38b4b3425b2742b (patch)
tree5ea7450c52c0d9e17ae64ccecea85a09a7395fa9 /net/tipc
parent2b27748f4a933dc772303dc8ded4e51a8d78b108 (diff)
net: tipc: Replace expression with offsetof()
Use the existing offsetof() macro instead of duplicating code. Signed-off-by: Zheng Yongjun <zhengyongjun3@huawei.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/tipc')
-rw-r--r--net/tipc/monitor.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/net/tipc/monitor.c b/net/tipc/monitor.c
index 6dce2abf436e..48fac3b17e40 100644
--- a/net/tipc/monitor.c
+++ b/net/tipc/monitor.c
@@ -108,7 +108,7 @@ const int tipc_max_domain_size = sizeof(struct tipc_mon_domain);
*/
static int dom_rec_len(struct tipc_mon_domain *dom, u16 mcnt)
{
- return ((void *)&dom->members - (void *)dom) + (mcnt * sizeof(u32));
+ return (offsetof(struct tipc_mon_domain, members)) + (mcnt * sizeof(u32));
}
/* dom_size() : calculate size of own domain based on number of peers