Patchwork [net-next] ipv6: Use FIELD_SIZEOF() instead of dummy variable.

login
register
mail settings
Submitter YOSHIFUJI Hideaki / 吉藤英明
Date Jan. 9, 2013, 3:31 p.m.
Message ID <50ED8D35.8070506@linux-ipv6.org>
Download mbox | patch
Permalink /patch/210729/
State Superseded
Delegated to: David Miller
Headers show

Comments

YOSHIFUJI Hideaki / 吉藤英明 - Jan. 9, 2013, 3:31 p.m.
Signed-off-by: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>
---
 net/ipv6/af_inet6.c |    3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
YOSHIFUJI Hideaki / 吉藤英明 - Jan. 9, 2013, 4:56 p.m.
YOSHIFUJI Hideaki wrote:
> Signed-off-by: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>
> ---
>  net/ipv6/af_inet6.c |    3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/net/ipv6/af_inet6.c b/net/ipv6/af_inet6.c
> index b043c60..6b793bf 100644
> --- a/net/ipv6/af_inet6.c
> +++ b/net/ipv6/af_inet6.c
> @@ -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)
> 

I'm resending this one with others.

--yoshfuji
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Patch

diff --git a/net/ipv6/af_inet6.c b/net/ipv6/af_inet6.c
index b043c60..6b793bf 100644
--- a/net/ipv6/af_inet6.c
+++ b/net/ipv6/af_inet6.c
@@ -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)