diff options
author | Sven Eckelmann <sven@narfation.org> | 2011-05-15 01:14:54 +0400 |
---|---|---|
committer | Sven Eckelmann <sven@narfation.org> | 2011-05-30 09:39:33 +0400 |
commit | 704509b8d44886cebfbaff1a9813c35dfa986954 (patch) | |
tree | 7b353f1d4a33b31d55d2a85f8d70882ade1868ce /net/batman-adv/unicast.h | |
parent | 958ca5985604a6f13387d32de489365df816558b (diff) | |
download | linux-704509b8d44886cebfbaff1a9813c35dfa986954.tar.xz |
batman-adv: Calculate sizeof using variable insead of types
Documentation/CodingStyle recommends to use the form
p = kmalloc(sizeof(*p), ...);
to calculate the size of a struct and not the version where the struct
name is spelled out to prevent bugs when the type of p changes. This
also seems appropriate for manipulation of buffers when they are
directly associated with p.
Signed-off-by: Sven Eckelmann <sven@narfation.org>
Diffstat (limited to 'net/batman-adv/unicast.h')
-rw-r--r-- | net/batman-adv/unicast.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/net/batman-adv/unicast.h b/net/batman-adv/unicast.h index 2ba867cf4135..62f54b954625 100644 --- a/net/batman-adv/unicast.h +++ b/net/batman-adv/unicast.h @@ -49,7 +49,7 @@ static inline int frag_can_reassemble(const struct sk_buff *skb, int mtu) uneven_correction = -1; } - merged_size = (skb->len - sizeof(struct unicast_frag_packet)) * 2; + merged_size = (skb->len - sizeof(*unicast_packet)) * 2; merged_size += sizeof(struct unicast_packet) + uneven_correction; return merged_size <= mtu; |