projects
/
platform
/
kernel
/
linux-starfive.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
2b27748
)
net: tipc: Replace expression with offsetof()
author
Zheng Yongjun
<zhengyongjun3@huawei.com>
Tue, 29 Dec 2020 13:49:04 +0000
(21:49 +0800)
committer
David S. Miller
<davem@davemloft.net>
Tue, 5 Jan 2021 23:43:41 +0000
(15:43 -0800)
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>
net/tipc/monitor.c
patch
|
blob
|
history
diff --git
a/net/tipc/monitor.c
b/net/tipc/monitor.c
index
6dce2ab
..
48fac3b
100644
(file)
--- 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