linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH][next] mlxsw: spectrum_ptp: fix duplicated check on orig_egr_types
@ 2019-07-30 10:21 Colin King
  2019-07-30 11:00 ` Petr Machata
  0 siblings, 1 reply; 5+ messages in thread
From: Colin King @ 2019-07-30 10:21 UTC (permalink / raw)
  To: Petr Machata, Jiri Pirko, Ido Schimmel, David S . Miller, netdev
  Cc: kernel-janitors, linux-kernel

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

Currently there is a duplicated check on orig_egr_types which is
redundant, I believe this is a typo and should actually be
orig_ing_types || orig_egr_types instead of the expression
orig_egr_types || orig_egr_types.  Fix this.

Addresses-Coverity: ("Same on both sides")
Fixes: c6b36bdd04b5 ("mlxsw: spectrum_ptp: Increase parsing depth when PTP is enabled")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
 drivers/net/ethernet/mellanox/mlxsw/spectrum_ptp.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum_ptp.c b/drivers/net/ethernet/mellanox/mlxsw/spectrum_ptp.c
index 98c5ba3200bc..f02d74e55d95 100644
--- a/drivers/net/ethernet/mellanox/mlxsw/spectrum_ptp.c
+++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum_ptp.c
@@ -999,7 +999,7 @@ static int mlxsw_sp1_ptp_mtpppc_update(struct mlxsw_sp_port *mlxsw_sp_port,
 		}
 	}
 
-	if ((ing_types || egr_types) && !(orig_egr_types || orig_egr_types)) {
+	if ((ing_types || egr_types) && !(orig_ing_types || orig_egr_types)) {
 		err = mlxsw_sp_nve_inc_parsing_depth_get(mlxsw_sp);
 		if (err) {
 			netdev_err(mlxsw_sp_port->dev, "Failed to increase parsing depth");
-- 
2.20.1


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

* Re: [PATCH][next] mlxsw: spectrum_ptp: fix duplicated check on orig_egr_types
  2019-07-30 10:21 [PATCH][next] mlxsw: spectrum_ptp: fix duplicated check on orig_egr_types Colin King
@ 2019-07-30 11:00 ` Petr Machata
  2019-07-30 11:05   ` Petr Machata
  2019-07-30 11:12   ` Petr Machata
  0 siblings, 2 replies; 5+ messages in thread
From: Petr Machata @ 2019-07-30 11:00 UTC (permalink / raw)
  To: Colin King
  Cc: Jiri Pirko, Ido Schimmel, David S . Miller, netdev,
	kernel-janitors, linux-kernel


Colin King <colin.king@canonical.com> writes:

> From: Colin Ian King <colin.king@canonical.com>
>
> Currently there is a duplicated check on orig_egr_types which is
> redundant, I believe this is a typo and should actually be
> orig_ing_types || orig_egr_types instead of the expression
> orig_egr_types || orig_egr_types.  Fix this.

Good catch, yes, there's a typo. Thanks for the fix!

> Addresses-Coverity: ("Same on both sides")
> Fixes: c6b36bdd04b5 ("mlxsw: spectrum_ptp: Increase parsing depth when PTP is enabled")
> Signed-off-by: Colin Ian King <colin.king@canonical.com>

Reviewed-by: Petr Machata <petrm@mellanox.com>

> ---
>  drivers/net/ethernet/mellanox/mlxsw/spectrum_ptp.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum_ptp.c b/drivers/net/ethernet/mellanox/mlxsw/spectrum_ptp.c
> index 98c5ba3200bc..f02d74e55d95 100644
> --- a/drivers/net/ethernet/mellanox/mlxsw/spectrum_ptp.c
> +++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum_ptp.c
> @@ -999,7 +999,7 @@ static int mlxsw_sp1_ptp_mtpppc_update(struct mlxsw_sp_port *mlxsw_sp_port,
>  		}
>  	}
>  
> -	if ((ing_types || egr_types) && !(orig_egr_types || orig_egr_types)) {
> +	if ((ing_types || egr_types) && !(orig_ing_types || orig_egr_types)) {
>  		err = mlxsw_sp_nve_inc_parsing_depth_get(mlxsw_sp);
>  		if (err) {
>  			netdev_err(mlxsw_sp_port->dev, "Failed to increase parsing depth");


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

* Re: [PATCH][next] mlxsw: spectrum_ptp: fix duplicated check on orig_egr_types
  2019-07-30 11:00 ` Petr Machata
@ 2019-07-30 11:05   ` Petr Machata
  2019-07-30 11:12   ` Petr Machata
  1 sibling, 0 replies; 5+ messages in thread
From: Petr Machata @ 2019-07-30 11:05 UTC (permalink / raw)
  To: Colin King
  Cc: Jiri Pirko, Ido Schimmel, David S . Miller, netdev,
	kernel-janitors, linux-kernel


Petr Machata <petrm@mellanox.com> writes:

> Colin King <colin.king@canonical.com> writes:
>
>> From: Colin Ian King <colin.king@canonical.com>
>>
>> Currently there is a duplicated check on orig_egr_types which is
>> redundant, I believe this is a typo and should actually be
>> orig_ing_types || orig_egr_types instead of the expression
>> orig_egr_types || orig_egr_types.  Fix this.
>
> Good catch, yes, there's a typo. Thanks for the fix!
>
>> Addresses-Coverity: ("Same on both sides")
>> Fixes: c6b36bdd04b5 ("mlxsw: spectrum_ptp: Increase parsing depth when PTP is enabled")
>> Signed-off-by: Colin Ian King <colin.king@canonical.com>
>
> Reviewed-by: Petr Machata <petrm@mellanox.com>

However the patch should address "net", not "next". Can you please respin?

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

* Re: [PATCH][next] mlxsw: spectrum_ptp: fix duplicated check on orig_egr_types
  2019-07-30 11:00 ` Petr Machata
  2019-07-30 11:05   ` Petr Machata
@ 2019-07-30 11:12   ` Petr Machata
  2019-07-30 11:37     ` Colin Ian King
  1 sibling, 1 reply; 5+ messages in thread
From: Petr Machata @ 2019-07-30 11:12 UTC (permalink / raw)
  To: Colin King
  Cc: Jiri Pirko, Ido Schimmel, David S . Miller, netdev,
	kernel-janitors, linux-kernel


Petr Machata <petrm@mellanox.com> writes:

> Colin King <colin.king@canonical.com> writes:
>
>> From: Colin Ian King <colin.king@canonical.com>
>>
>> Currently there is a duplicated check on orig_egr_types which is
>> redundant, I believe this is a typo and should actually be
>> orig_ing_types || orig_egr_types instead of the expression
>> orig_egr_types || orig_egr_types.  Fix this.
>
> Good catch, yes, there's a typo. Thanks for the fix!
>
>> Addresses-Coverity: ("Same on both sides")
>> Fixes: c6b36bdd04b5 ("mlxsw: spectrum_ptp: Increase parsing depth when PTP is enabled")
>> Signed-off-by: Colin Ian King <colin.king@canonical.com>
>
> Reviewed-by: Petr Machata <petrm@mellanox.com>

I see that there is an identical problem in the code one block further.
Can you take care of that as well, please? Or should I do it?

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

* Re: [PATCH][next] mlxsw: spectrum_ptp: fix duplicated check on orig_egr_types
  2019-07-30 11:12   ` Petr Machata
@ 2019-07-30 11:37     ` Colin Ian King
  0 siblings, 0 replies; 5+ messages in thread
From: Colin Ian King @ 2019-07-30 11:37 UTC (permalink / raw)
  To: Petr Machata
  Cc: Jiri Pirko, Ido Schimmel, David S . Miller, netdev,
	kernel-janitors, linux-kernel

On 30/07/2019 12:12, Petr Machata wrote:
> 
> Petr Machata <petrm@mellanox.com> writes:
> 
>> Colin King <colin.king@canonical.com> writes:
>>
>>> From: Colin Ian King <colin.king@canonical.com>
>>>
>>> Currently there is a duplicated check on orig_egr_types which is
>>> redundant, I believe this is a typo and should actually be
>>> orig_ing_types || orig_egr_types instead of the expression
>>> orig_egr_types || orig_egr_types.  Fix this.
>>
>> Good catch, yes, there's a typo. Thanks for the fix!
>>
>>> Addresses-Coverity: ("Same on both sides")
>>> Fixes: c6b36bdd04b5 ("mlxsw: spectrum_ptp: Increase parsing depth when PTP is enabled")
>>> Signed-off-by: Colin Ian King <colin.king@canonical.com>
>>
>> Reviewed-by: Petr Machata <petrm@mellanox.com>
> 
> I see that there is an identical problem in the code one block further.
> Can you take care of that as well, please? Or should I do it?
> 
I'll sort that out too


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

end of thread, other threads:[~2019-07-30 11:37 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-07-30 10:21 [PATCH][next] mlxsw: spectrum_ptp: fix duplicated check on orig_egr_types Colin King
2019-07-30 11:00 ` Petr Machata
2019-07-30 11:05   ` Petr Machata
2019-07-30 11:12   ` Petr Machata
2019-07-30 11:37     ` Colin Ian King

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).