Skip to contentSkip to conversation

ipv6: Use FIELD_SIZEOF() instead of dummy variable.

PATCH In review YOSHIFUJI Hideaki 1 participant 2 messages Jan 9, 2013

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ipv6: Use FIELD_SIZEOF() instead of dummy variable.

---
 net/ipv6/af_inet6.c |    3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
net/ipv6/af_inet6.c +1 -2
index b043c60..6b793bf 100644
@@ -811,11 +811,10 @@ static struct pernet_operations inet6_net_ops = {
 
 static int __init inet6_init(void)
 {
-	struct sk_buff *dummy_skb;
 	struct list_head *r;
 	int err = 0;
 
-	BUILD_BUG_ON(sizeof(struct inet6_skb_parm) > sizeof(dummy_skb->cb));
+	BUILD_BUG_ON(sizeof(struct inet6_skb_parm) > FIELD_SIZEOF(struct sk_buff, cb));
 
 	/* Register the socket-side information for inet6_create.  */
 	for (r = &inetsw6[0]; r < &inetsw6[SOCK_MAX]; ++r)
Signature · 1 line
1.7.9.5
#1 lore raw
Quoted 13 lines · YOSHIFUJI Hideaki
---
 net/ipv6/af_inet6.c |    3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
net/ipv6/af_inet6.c +0 -0
index b043c60..6b793bf 100644
@@ -811,11 +811,10 @@ static struct pernet_operations inet6_net_ops = {
 
 static int __init inet6_init(void)

net/ipv6/af_inet6.c static struct pernet_operations inet6_net_ops = { · line 820

Quoted 10 lines
net/ipv6/af_inet6.c +1 -2
 {
-	struct sk_buff *dummy_skb;
 	struct list_head *r;
 	int err = 0;
 
-	BUILD_BUG_ON(sizeof(struct inet6_skb_parm) > sizeof(dummy_skb->cb));
+	BUILD_BUG_ON(sizeof(struct inet6_skb_parm) > FIELD_SIZEOF(struct sk_buff, cb));
 
 	/* Register the socket-side information for inet6_create.  */
 	for (r = &inetsw6[0]; r < &inetsw6[SOCK_MAX]; ++r)

I'm resending this one with others.

--yoshfuji