tipc: Use struct_size() helper
Make use of the struct_size() helper instead of an open-coded version in order to avoid any potential type mistakes. This code was detected with the help of Coccinelle and, audited and fixed manually. Signed-off-by: Gustavo A. R. Silva <gustavoars@kernel.org> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:

committed by
David S. Miller

parent
70fc6d9c14
commit
e034c6d23b
@@ -189,11 +189,9 @@ struct tipc_gap_ack_blks {
|
||||
struct tipc_gap_ack gacks[];
|
||||
};
|
||||
|
||||
#define tipc_gap_ack_blks_sz(n) (sizeof(struct tipc_gap_ack_blks) + \
|
||||
sizeof(struct tipc_gap_ack) * (n))
|
||||
|
||||
#define MAX_GAP_ACK_BLKS 128
|
||||
#define MAX_GAP_ACK_BLKS_SZ tipc_gap_ack_blks_sz(MAX_GAP_ACK_BLKS)
|
||||
#define MAX_GAP_ACK_BLKS_SZ (sizeof(struct tipc_gap_ack_blks) + \
|
||||
sizeof(struct tipc_gap_ack) * MAX_GAP_ACK_BLKS)
|
||||
|
||||
static inline struct tipc_msg *buf_msg(struct sk_buff *skb)
|
||||
{
|
||||
|
Reference in New Issue
Block a user