diff options
author | Zheng Yongjun <zhengyongjun3@huawei.com> | 2020-12-29 14:49:04 +0100 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2021-01-06 00:43:41 +0100 |
commit | 520ec34385d57ae18ec034ddc38b4b3425b2742b (patch) | |
tree | 5ea7450c52c0d9e17ae64ccecea85a09a7395fa9 /net/tipc/monitor.c | |
parent | net: wan: Replace simple_strtol by simple_strtoul (diff) | |
download | linux-520ec34385d57ae18ec034ddc38b4b3425b2742b.tar.xz linux-520ec34385d57ae18ec034ddc38b4b3425b2742b.zip |
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/monitor.c')
-rw-r--r-- | net/tipc/monitor.c | 2 |
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 |