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:
Родитель
2b27748f4a
Коммит
520ec34385
|
@ -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
|
||||
|
|
Загрузка…
Ссылка в новой задаче