mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-04-13 09:59:31 +00:00
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>
This commit is contained in:
parent
2b27748f4a
commit
520ec34385
1 changed files with 1 additions and 1 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Reference in a new issue