Subject: Re: [PATCH net-next v2] ipv6: coding style improvements (remove assignment in if statements)

From: Joe Perches <[email-masked]>
Date: Sun, 23 Nov 2014 13:50:09 -0800

On Sun, 2014-11-23 at 21:28 +0000, Ian Morris wrote:
> This change has no functional impact and simply addresses some coding
> style issues detected by checkpatch. Specifically this change
> adjusts "if" statements which also include the assignment of a
> variable.

Unrelated trivia:

>  net/ipv6/addrconf.c      | 12 ++++++++----
[]
> diff --git a/net/ipv6/addrconf.c b/net/ipv6/addrconf.c
[]
> @@ -2690,7 +2691,8 @@ static void init_loopback(struct net_device *dev)
>  
>  	ASSERT_RTNL();
>  
> -	if ((idev = ipv6_find_idev(dev)) == NULL) {
> +	idev = ipv6_find_idev(dev);
> +	if (idev == NULL) {
>  		pr_debug("%s: add_dev failed\n", __func__);
>  		return;
>  	}
> @@ -2813,7 +2815,8 @@ static void addrconf_sit_config(struct net_device *dev)
>  	 * our v4 addrs in the tunnel
>  	 */
>  
> -	if ((idev = ipv6_find_idev(dev)) == NULL) {
> +	idev = ipv6_find_idev(dev);
> +	if (idev == NULL) {
>  		pr_debug("%s: add_dev failed\n", __func__);
>  		return;
>  	}
> @@ -2837,7 +2840,8 @@ static void addrconf_gre_config(struct net_device *dev)
>  
>  	ASSERT_RTNL();
>  
> -	if ((idev = ipv6_find_idev(dev)) == NULL) {
> +	idev = ipv6_find_idev(dev);
> +	if (idev == NULL) {
>  		pr_debug("%s: add_dev failed\n", __func__);
>  		return;
>  	}

It looks like these should not be "add_dev failed"
but "ipv6_find_idev failed"