mlxsw: spectrum: fix swapped order of arguments packets and bytes

Message ID 20170320113722.30311-1-colin.king@canonical.com
State Accepted
Delegated to: David Miller
Headers show

Commit Message

Colin King March 20, 2017, 11:37 a.m.
From: Colin Ian King <colin.king@canonical.com>

The arguments packets and bytes to call mlxsw_sp_acl_rule_get_stats are
in the wrong order. Fix this by swapping them.

Detected by CoverityScan, CID#1419705 ("Arguments in wrong order")

Fixes: 7c1b8eb175b69add8ea ("mlxsw: spectrum: Add support for TC flower offload statistics")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
 drivers/net/ethernet/mellanox/mlxsw/spectrum_flower.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Ido Schimmel March 20, 2017, 12:16 p.m. | #1
On Mon, Mar 20, 2017 at 11:37:22AM +0000, Colin King wrote:
> From: Colin Ian King <colin.king@canonical.com>
> 
> The arguments packets and bytes to call mlxsw_sp_acl_rule_get_stats are
> in the wrong order. Fix this by swapping them.
> 
> Detected by CoverityScan, CID#1419705 ("Arguments in wrong order")
> 
> Fixes: 7c1b8eb175b69add8ea ("mlxsw: spectrum: Add support for TC flower offload statistics")

Only need first 12 characters.

> Signed-off-by: Colin Ian King <colin.king@canonical.com>

Acked-by: Ido Schimmel <idosch@mellanox.com>

Thanks!
Jiri Pirko March 20, 2017, 12:20 p.m. | #2
Mon, Mar 20, 2017 at 12:37:22PM CET, colin.king@canonical.com wrote:
>From: Colin Ian King <colin.king@canonical.com>
>
>The arguments packets and bytes to call mlxsw_sp_acl_rule_get_stats are
>in the wrong order. Fix this by swapping them.
>
>Detected by CoverityScan, CID#1419705 ("Arguments in wrong order")
>
>Fixes: 7c1b8eb175b69add8ea ("mlxsw: spectrum: Add support for TC flower offload statistics")
>Signed-off-by: Colin Ian King <colin.king@canonical.com>

Acked-by: Jiri Pirko <jiri@mellanox.com>
David Miller March 22, 2017, 6:13 p.m. | #3
From: Colin King <colin.king@canonical.com>
Date: Mon, 20 Mar 2017 11:37:22 +0000

> From: Colin Ian King <colin.king@canonical.com>
> 
> The arguments packets and bytes to call mlxsw_sp_acl_rule_get_stats are
> in the wrong order. Fix this by swapping them.
> 
> Detected by CoverityScan, CID#1419705 ("Arguments in wrong order")
> 
> Fixes: 7c1b8eb175b69add8ea ("mlxsw: spectrum: Add support for TC flower offload statistics")
> Signed-off-by: Colin Ian King <colin.king@canonical.com>

Applied, thanks.

Patch

diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum_flower.c b/drivers/net/ethernet/mellanox/mlxsw/spectrum_flower.c
index e724c6266247..3e7a0bcbba72 100644
--- a/drivers/net/ethernet/mellanox/mlxsw/spectrum_flower.c
+++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum_flower.c
@@ -375,7 +375,7 @@  int mlxsw_sp_flower_stats(struct mlxsw_sp_port *mlxsw_sp_port, bool ingress,
 	if (!rule)
 		return -EINVAL;
 
-	err = mlxsw_sp_acl_rule_get_stats(mlxsw_sp, rule, &bytes, &packets,
+	err = mlxsw_sp_acl_rule_get_stats(mlxsw_sp, rule, &packets, &bytes,
 					  &lastuse);
 	if (err)
 		goto err_rule_get_stats;