All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH][net-next] net: bridge: remove redundant check to see if err is set
@ 2017-02-07 10:56 ` Colin King
  0 siblings, 0 replies; 13+ messages in thread
From: Colin King @ 2017-02-07 10:56 UTC (permalink / raw)
  To: Stephen Hemminger, David S . Miller, bridge, netdev
  Cc: kernel-janitors, linux-kernel

From: Colin Ian King <colin.king@canonical.com>

The error check on err is redundant as it is being checked
previously each time it has been updated.  Remove this redundant
check.

Detected with CoverityScan, CID#140030("Logically dead code")

Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
 net/bridge/br_netlink.c | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/net/bridge/br_netlink.c b/net/bridge/br_netlink.c
index fc5d885..cdc4e2a 100644
--- a/net/bridge/br_netlink.c
+++ b/net/bridge/br_netlink.c
@@ -612,9 +612,6 @@ static int br_afspec(struct net_bridge *br,
 				return err;
 			break;
 		}
-
-		if (err)
-			return err;
 	}
 
 	return err;
-- 
2.10.2

^ permalink raw reply related	[flat|nested] 13+ messages in thread

* [PATCH][net-next] net: bridge: remove redundant check to see if err is set
@ 2017-02-07 10:56 ` Colin King
  0 siblings, 0 replies; 13+ messages in thread
From: Colin King @ 2017-02-07 10:56 UTC (permalink / raw)
  To: Stephen Hemminger, David S . Miller, bridge, netdev
  Cc: kernel-janitors, linux-kernel

From: Colin Ian King <colin.king@canonical.com>

The error check on err is redundant as it is being checked
previously each time it has been updated.  Remove this redundant
check.

Detected with CoverityScan, CID#140030("Logically dead code")

Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
 net/bridge/br_netlink.c | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/net/bridge/br_netlink.c b/net/bridge/br_netlink.c
index fc5d885..cdc4e2a 100644
--- a/net/bridge/br_netlink.c
+++ b/net/bridge/br_netlink.c
@@ -612,9 +612,6 @@ static int br_afspec(struct net_bridge *br,
 				return err;
 			break;
 		}
-
-		if (err)
-			return err;
 	}
 
 	return err;
-- 
2.10.2


^ permalink raw reply related	[flat|nested] 13+ messages in thread

* [Bridge] [PATCH][net-next] net: bridge: remove redundant check to see if err is set
@ 2017-02-07 10:56 ` Colin King
  0 siblings, 0 replies; 13+ messages in thread
From: Colin King @ 2017-02-07 10:56 UTC (permalink / raw)
  To: Stephen Hemminger, David S . Miller, bridge, netdev
  Cc: kernel-janitors, linux-kernel

From: Colin Ian King <colin.king@canonical.com>

The error check on err is redundant as it is being checked
previously each time it has been updated.  Remove this redundant
check.

Detected with CoverityScan, CID#140030("Logically dead code")

Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
 net/bridge/br_netlink.c | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/net/bridge/br_netlink.c b/net/bridge/br_netlink.c
index fc5d885..cdc4e2a 100644
--- a/net/bridge/br_netlink.c
+++ b/net/bridge/br_netlink.c
@@ -612,9 +612,6 @@ static int br_afspec(struct net_bridge *br,
 				return err;
 			break;
 		}
-
-		if (err)
-			return err;
 	}
 
 	return err;
-- 
2.10.2


^ permalink raw reply related	[flat|nested] 13+ messages in thread

* Re: [PATCH][net-next] net: bridge: remove redundant check to see if err is set
  2017-02-07 10:56 ` Colin King
  (?)
@ 2017-02-07 11:30   ` Nikolay Aleksandrov
  -1 siblings, 0 replies; 13+ messages in thread
From: Nikolay Aleksandrov @ 2017-02-07 11:30 UTC (permalink / raw)
  To: Colin King, Stephen Hemminger, David S . Miller, bridge, netdev
  Cc: kernel-janitors, linux-kernel

On 07/02/17 11:56, Colin King wrote:
> From: Colin Ian King <colin.king@canonical.com>
> 
> The error check on err is redundant as it is being checked
> previously each time it has been updated.  Remove this redundant
> check.
> 
> Detected with CoverityScan, CID#140030("Logically dead code")
> 
> Signed-off-by: Colin Ian King <colin.king@canonical.com>
> ---
>  net/bridge/br_netlink.c | 3 ---
>  1 file changed, 3 deletions(-)
> 
> diff --git a/net/bridge/br_netlink.c b/net/bridge/br_netlink.c
> index fc5d885..cdc4e2a 100644
> --- a/net/bridge/br_netlink.c
> +++ b/net/bridge/br_netlink.c
> @@ -612,9 +612,6 @@ static int br_afspec(struct net_bridge *br,
>  				return err;
>  			break;
>  		}
> -
> -		if (err)
> -			return err;
>  	}
>  
>  	return err;
> 

Actually that code can be reduced further, I'll follow up with a patch later.

Reviewed-by: Nikolay Aleksandrov <nikolay@cumulusnetworks.com>

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH][net-next] net: bridge: remove redundant check to see if err is set
@ 2017-02-07 11:30   ` Nikolay Aleksandrov
  0 siblings, 0 replies; 13+ messages in thread
From: Nikolay Aleksandrov @ 2017-02-07 11:30 UTC (permalink / raw)
  To: Colin King, Stephen Hemminger, David S . Miller, bridge, netdev
  Cc: kernel-janitors, linux-kernel

On 07/02/17 11:56, Colin King wrote:
> From: Colin Ian King <colin.king@canonical.com>
> 
> The error check on err is redundant as it is being checked
> previously each time it has been updated.  Remove this redundant
> check.
> 
> Detected with CoverityScan, CID#140030("Logically dead code")
> 
> Signed-off-by: Colin Ian King <colin.king@canonical.com>
> ---
>  net/bridge/br_netlink.c | 3 ---
>  1 file changed, 3 deletions(-)
> 
> diff --git a/net/bridge/br_netlink.c b/net/bridge/br_netlink.c
> index fc5d885..cdc4e2a 100644
> --- a/net/bridge/br_netlink.c
> +++ b/net/bridge/br_netlink.c
> @@ -612,9 +612,6 @@ static int br_afspec(struct net_bridge *br,
>  				return err;
>  			break;
>  		}
> -
> -		if (err)
> -			return err;
>  	}
>  
>  	return err;
> 

Actually that code can be reduced further, I'll follow up with a patch later.

Reviewed-by: Nikolay Aleksandrov <nikolay@cumulusnetworks.com>


^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [Bridge] [PATCH][net-next] net: bridge: remove redundant check to see if err is set
@ 2017-02-07 11:30   ` Nikolay Aleksandrov
  0 siblings, 0 replies; 13+ messages in thread
From: Nikolay Aleksandrov @ 2017-02-07 11:30 UTC (permalink / raw)
  To: Colin King, Stephen Hemminger, David S . Miller, bridge, netdev
  Cc: kernel-janitors, linux-kernel

On 07/02/17 11:56, Colin King wrote:
> From: Colin Ian King <colin.king@canonical.com>
> 
> The error check on err is redundant as it is being checked
> previously each time it has been updated.  Remove this redundant
> check.
> 
> Detected with CoverityScan, CID#140030("Logically dead code")
> 
> Signed-off-by: Colin Ian King <colin.king@canonical.com>
> ---
>  net/bridge/br_netlink.c | 3 ---
>  1 file changed, 3 deletions(-)
> 
> diff --git a/net/bridge/br_netlink.c b/net/bridge/br_netlink.c
> index fc5d885..cdc4e2a 100644
> --- a/net/bridge/br_netlink.c
> +++ b/net/bridge/br_netlink.c
> @@ -612,9 +612,6 @@ static int br_afspec(struct net_bridge *br,
>  				return err;
>  			break;
>  		}
> -
> -		if (err)
> -			return err;
>  	}
>  
>  	return err;
> 

Actually that code can be reduced further, I'll follow up with a patch later.

Reviewed-by: Nikolay Aleksandrov <nikolay@cumulusnetworks.com>


^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH][net-next] net: bridge: remove redundant check to see if err is set
  2017-02-07 11:30   ` Nikolay Aleksandrov
  (?)
@ 2017-02-07 11:43     ` Colin Ian King
  -1 siblings, 0 replies; 13+ messages in thread
From: Colin Ian King @ 2017-02-07 11:43 UTC (permalink / raw)
  To: Nikolay Aleksandrov, Stephen Hemminger, David S . Miller, bridge, netdev
  Cc: kernel-janitors, linux-kernel

..and one more thing, in net/bridge/br_netlink_tunnel.c,
__get_num_vlan_tunnel_infos, are the args to vlan_tunnel_id_isrange()
the wrong way around? I'm not 100% sure, but I'd thought I'd flag it up.


        if (v_start) {
                if ((v_end->vid - v->vid) > 0 &&
                    vlan_tunnel_id_isrange(v_end, v) > 0)
                        num_tinfos += 2;
                else
                        num_tinfos += 1;
        }



On 07/02/17 11:30, Nikolay Aleksandrov wrote:
> On 07/02/17 11:56, Colin King wrote:
>> From: Colin Ian King <colin.king@canonical.com>
>>
>> The error check on err is redundant as it is being checked
>> previously each time it has been updated.  Remove this redundant
>> check.
>>
>> Detected with CoverityScan, CID#140030("Logically dead code")
>>
>> Signed-off-by: Colin Ian King <colin.king@canonical.com>
>> ---
>>  net/bridge/br_netlink.c | 3 ---
>>  1 file changed, 3 deletions(-)
>>
>> diff --git a/net/bridge/br_netlink.c b/net/bridge/br_netlink.c
>> index fc5d885..cdc4e2a 100644
>> --- a/net/bridge/br_netlink.c
>> +++ b/net/bridge/br_netlink.c
>> @@ -612,9 +612,6 @@ static int br_afspec(struct net_bridge *br,
>>  				return err;
>>  			break;
>>  		}
>> -
>> -		if (err)
>> -			return err;
>>  	}
>>  
>>  	return err;
>>
> 
> Actually that code can be reduced further, I'll follow up with a patch later.
> 
> Reviewed-by: Nikolay Aleksandrov <nikolay@cumulusnetworks.com>
> 
> --
> To unsubscribe from this list: send the line "unsubscribe kernel-janitors" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH][net-next] net: bridge: remove redundant check to see if err is set
@ 2017-02-07 11:43     ` Colin Ian King
  0 siblings, 0 replies; 13+ messages in thread
From: Colin Ian King @ 2017-02-07 11:43 UTC (permalink / raw)
  To: Nikolay Aleksandrov, Stephen Hemminger, David S . Miller, bridge, netdev
  Cc: kernel-janitors, linux-kernel

..and one more thing, in net/bridge/br_netlink_tunnel.c,
__get_num_vlan_tunnel_infos, are the args to vlan_tunnel_id_isrange()
the wrong way around? I'm not 100% sure, but I'd thought I'd flag it up.


        if (v_start) {
                if ((v_end->vid - v->vid) > 0 &&
                    vlan_tunnel_id_isrange(v_end, v) > 0)
                        num_tinfos += 2;
                else
                        num_tinfos += 1;
        }



On 07/02/17 11:30, Nikolay Aleksandrov wrote:
> On 07/02/17 11:56, Colin King wrote:
>> From: Colin Ian King <colin.king@canonical.com>
>>
>> The error check on err is redundant as it is being checked
>> previously each time it has been updated.  Remove this redundant
>> check.
>>
>> Detected with CoverityScan, CID#140030("Logically dead code")
>>
>> Signed-off-by: Colin Ian King <colin.king@canonical.com>
>> ---
>>  net/bridge/br_netlink.c | 3 ---
>>  1 file changed, 3 deletions(-)
>>
>> diff --git a/net/bridge/br_netlink.c b/net/bridge/br_netlink.c
>> index fc5d885..cdc4e2a 100644
>> --- a/net/bridge/br_netlink.c
>> +++ b/net/bridge/br_netlink.c
>> @@ -612,9 +612,6 @@ static int br_afspec(struct net_bridge *br,
>>  				return err;
>>  			break;
>>  		}
>> -
>> -		if (err)
>> -			return err;
>>  	}
>>  
>>  	return err;
>>
> 
> Actually that code can be reduced further, I'll follow up with a patch later.
> 
> Reviewed-by: Nikolay Aleksandrov <nikolay@cumulusnetworks.com>
> 
> --
> To unsubscribe from this list: send the line "unsubscribe kernel-janitors" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 


^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [Bridge] [PATCH][net-next] net: bridge: remove redundant check to see if err is set
@ 2017-02-07 11:43     ` Colin Ian King
  0 siblings, 0 replies; 13+ messages in thread
From: Colin Ian King @ 2017-02-07 11:43 UTC (permalink / raw)
  To: Nikolay Aleksandrov, Stephen Hemminger, David S . Miller, bridge, netdev
  Cc: kernel-janitors, linux-kernel

..and one more thing, in net/bridge/br_netlink_tunnel.c,
__get_num_vlan_tunnel_infos, are the args to vlan_tunnel_id_isrange()
the wrong way around? I'm not 100% sure, but I'd thought I'd flag it up.


        if (v_start) {
                if ((v_end->vid - v->vid) > 0 &&
                    vlan_tunnel_id_isrange(v_end, v) > 0)
                        num_tinfos += 2;
                else
                        num_tinfos += 1;
        }



On 07/02/17 11:30, Nikolay Aleksandrov wrote:
> On 07/02/17 11:56, Colin King wrote:
>> From: Colin Ian King <colin.king@canonical.com>
>>
>> The error check on err is redundant as it is being checked
>> previously each time it has been updated.  Remove this redundant
>> check.
>>
>> Detected with CoverityScan, CID#140030("Logically dead code")
>>
>> Signed-off-by: Colin Ian King <colin.king@canonical.com>
>> ---
>>  net/bridge/br_netlink.c | 3 ---
>>  1 file changed, 3 deletions(-)
>>
>> diff --git a/net/bridge/br_netlink.c b/net/bridge/br_netlink.c
>> index fc5d885..cdc4e2a 100644
>> --- a/net/bridge/br_netlink.c
>> +++ b/net/bridge/br_netlink.c
>> @@ -612,9 +612,6 @@ static int br_afspec(struct net_bridge *br,
>>  				return err;
>>  			break;
>>  		}
>> -
>> -		if (err)
>> -			return err;
>>  	}
>>  
>>  	return err;
>>
> 
> Actually that code can be reduced further, I'll follow up with a patch later.
> 
> Reviewed-by: Nikolay Aleksandrov <nikolay@cumulusnetworks.com>
> 
> --
> To unsubscribe from this list: send the line "unsubscribe kernel-janitors" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 


^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH][net-next] net: bridge: remove redundant check to see if err is set
  2017-02-07 10:56 ` Colin King
  (?)
  (?)
@ 2017-02-07 19:05   ` David Miller
  -1 siblings, 0 replies; 13+ messages in thread
From: David Miller @ 2017-02-07 19:05 UTC (permalink / raw)
  To: colin.king; +Cc: stephen, bridge, netdev, kernel-janitors, linux-kernel

From: Colin King <colin.king@canonical.com>
Date: Tue,  7 Feb 2017 10:56:38 +0000

> From: Colin Ian King <colin.king@canonical.com>
> 
> The error check on err is redundant as it is being checked
> previously each time it has been updated.  Remove this redundant
> check.
> 
> Detected with CoverityScan, CID#140030("Logically dead code")
> 
> Signed-off-by: Colin Ian King <colin.king@canonical.com>

Applied.

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH][net-next] net: bridge: remove redundant check to see if err is set
@ 2017-02-07 19:05   ` David Miller
  0 siblings, 0 replies; 13+ messages in thread
From: David Miller @ 2017-02-07 19:05 UTC (permalink / raw)
  To: colin.king; +Cc: netdev, bridge, kernel-janitors, linux-kernel

From: Colin King <colin.king@canonical.com>
Date: Tue,  7 Feb 2017 10:56:38 +0000

> From: Colin Ian King <colin.king@canonical.com>
> 
> The error check on err is redundant as it is being checked
> previously each time it has been updated.  Remove this redundant
> check.
> 
> Detected with CoverityScan, CID#140030("Logically dead code")
> 
> Signed-off-by: Colin Ian King <colin.king@canonical.com>

Applied.

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH][net-next] net: bridge: remove redundant check to see if err is set
@ 2017-02-07 19:05   ` David Miller
  0 siblings, 0 replies; 13+ messages in thread
From: David Miller @ 2017-02-07 19:05 UTC (permalink / raw)
  To: colin.king; +Cc: stephen, bridge, netdev, kernel-janitors, linux-kernel

From: Colin King <colin.king@canonical.com>
Date: Tue,  7 Feb 2017 10:56:38 +0000

> From: Colin Ian King <colin.king@canonical.com>
> 
> The error check on err is redundant as it is being checked
> previously each time it has been updated.  Remove this redundant
> check.
> 
> Detected with CoverityScan, CID#140030("Logically dead code")
> 
> Signed-off-by: Colin Ian King <colin.king@canonical.com>

Applied.

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [Bridge] [PATCH][net-next] net: bridge: remove redundant check to see if err is set
@ 2017-02-07 19:05   ` David Miller
  0 siblings, 0 replies; 13+ messages in thread
From: David Miller @ 2017-02-07 19:05 UTC (permalink / raw)
  To: colin.king; +Cc: netdev, bridge, kernel-janitors, linux-kernel

From: Colin King <colin.king@canonical.com>
Date: Tue,  7 Feb 2017 10:56:38 +0000

> From: Colin Ian King <colin.king@canonical.com>
> 
> The error check on err is redundant as it is being checked
> previously each time it has been updated.  Remove this redundant
> check.
> 
> Detected with CoverityScan, CID#140030("Logically dead code")
> 
> Signed-off-by: Colin Ian King <colin.king@canonical.com>

Applied.

^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2017-02-07 19:15 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-02-07 10:56 [PATCH][net-next] net: bridge: remove redundant check to see if err is set Colin King
2017-02-07 10:56 ` [Bridge] " Colin King
2017-02-07 10:56 ` Colin King
2017-02-07 11:30 ` Nikolay Aleksandrov
2017-02-07 11:30   ` [Bridge] " Nikolay Aleksandrov
2017-02-07 11:30   ` Nikolay Aleksandrov
2017-02-07 11:43   ` Colin Ian King
2017-02-07 11:43     ` [Bridge] " Colin Ian King
2017-02-07 11:43     ` Colin Ian King
2017-02-07 19:05 ` David Miller
2017-02-07 19:05   ` [Bridge] " David Miller
2017-02-07 19:05   ` David Miller
2017-02-07 19:05   ` David Miller

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.