Thread (5 messages) 5 messages, 4 authors, 2012-01-23

using sizeof operator

From: Daniel Baluta <hidden>
Date: 2012-01-22 18:27:13

On Sun, Jan 22, 2012 at 8:14 PM, Sukrit Sangwan [off-list ref] wrote:
There are instances in the code where sizeof(*ptr) is used. e.g.
in net/802/garp.c
? ? ? ? ? const struct garp_msg_hdr *gm;
? ? ? ? ? if (!pskb_may_pull(skb, sizeof(*gm)))
?return -1;
i want to ask is there any sense in using sizeof(struct garp_msg_hdr)
instead of sizeof(*gm) in the above example.
Imagine what would happen if you change the name of struct garp_msg_hdr;

thanks,
Daniel.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help