* [PATCH] net: ethernet: mlx4: Remove unnecessary parentheses
@ 2018-06-01 2:00 Varsha Rao
2018-06-03 7:15 ` Tariq Toukan
2018-06-04 14:15 ` David Miller
0 siblings, 2 replies; 3+ messages in thread
From: Varsha Rao @ 2018-06-01 2:00 UTC (permalink / raw)
To: Tariq Toukan, David S. Miller, Nicholas Mc Guire, Lukas Bulwahn,
netdev, linux-rdma, linux-kernel
Cc: Varsha Rao
This patch fixes the clang warning of extraneous parentheses, with the
following coccinelle script.
@@
identifier i;
expression e;
statement s;
@@
if (
-(i == e)
+i == e
)
s
Suggested-by: Lukas Bulwahn <lukas.bulwahn@gmail.com>
Signed-off-by: Varsha Rao <rvarsha016@gmail.com>
---
drivers/net/ethernet/mellanox/mlx4/port.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/net/ethernet/mellanox/mlx4/port.c b/drivers/net/ethernet/mellanox/mlx4/port.c
index 3ef3406ff4cb..10fcc22f4590 100644
--- a/drivers/net/ethernet/mellanox/mlx4/port.c
+++ b/drivers/net/ethernet/mellanox/mlx4/port.c
@@ -614,9 +614,9 @@ int __mlx4_register_vlan(struct mlx4_dev *dev, u8 port, u16 vlan,
int index_at_dup_port = -1;
for (i = MLX4_VLAN_REGULAR; i < MLX4_MAX_VLAN_NUM; i++) {
- if ((vlan == (MLX4_VLAN_MASK & be32_to_cpu(table->entries[i]))))
+ if (vlan == (MLX4_VLAN_MASK & be32_to_cpu(table->entries[i])))
index_at_port = i;
- if ((vlan == (MLX4_VLAN_MASK & be32_to_cpu(dup_table->entries[i]))))
+ if (vlan == (MLX4_VLAN_MASK & be32_to_cpu(dup_table->entries[i])))
index_at_dup_port = i;
}
/* check that same vlan is not in the tables at different indices */
--
2.17.0
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] net: ethernet: mlx4: Remove unnecessary parentheses
2018-06-01 2:00 [PATCH] net: ethernet: mlx4: Remove unnecessary parentheses Varsha Rao
@ 2018-06-03 7:15 ` Tariq Toukan
2018-06-04 14:15 ` David Miller
1 sibling, 0 replies; 3+ messages in thread
From: Tariq Toukan @ 2018-06-03 7:15 UTC (permalink / raw)
To: Varsha Rao, Tariq Toukan, David S. Miller, Nicholas Mc Guire,
Lukas Bulwahn, netdev, linux-rdma, linux-kernel
On 01/06/2018 5:00 AM, Varsha Rao wrote:
> This patch fixes the clang warning of extraneous parentheses, with the
> following coccinelle script.
>
> @@
> identifier i;
> expression e;
> statement s;
> @@
> if (
> -(i == e)
> +i == e
> )
> s
>
> Suggested-by: Lukas Bulwahn <lukas.bulwahn@gmail.com>
> Signed-off-by: Varsha Rao <rvarsha016@gmail.com>
> ---
> drivers/net/ethernet/mellanox/mlx4/port.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/net/ethernet/mellanox/mlx4/port.c b/drivers/net/ethernet/mellanox/mlx4/port.c
> index 3ef3406ff4cb..10fcc22f4590 100644
> --- a/drivers/net/ethernet/mellanox/mlx4/port.c
> +++ b/drivers/net/ethernet/mellanox/mlx4/port.c
> @@ -614,9 +614,9 @@ int __mlx4_register_vlan(struct mlx4_dev *dev, u8 port, u16 vlan,
> int index_at_dup_port = -1;
>
> for (i = MLX4_VLAN_REGULAR; i < MLX4_MAX_VLAN_NUM; i++) {
> - if ((vlan == (MLX4_VLAN_MASK & be32_to_cpu(table->entries[i]))))
> + if (vlan == (MLX4_VLAN_MASK & be32_to_cpu(table->entries[i])))
> index_at_port = i;
> - if ((vlan == (MLX4_VLAN_MASK & be32_to_cpu(dup_table->entries[i]))))
> + if (vlan == (MLX4_VLAN_MASK & be32_to_cpu(dup_table->entries[i])))
> index_at_dup_port = i;
> }
> /* check that same vlan is not in the tables at different indices */
>
Acked-by: Tariq Toukan <tariqt@mellanox.com>
Thanks for your patch,
Tariq
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] net: ethernet: mlx4: Remove unnecessary parentheses
2018-06-01 2:00 [PATCH] net: ethernet: mlx4: Remove unnecessary parentheses Varsha Rao
2018-06-03 7:15 ` Tariq Toukan
@ 2018-06-04 14:15 ` David Miller
1 sibling, 0 replies; 3+ messages in thread
From: David Miller @ 2018-06-04 14:15 UTC (permalink / raw)
To: rvarsha016
Cc: tariqt, der.herr, lukas.bulwahn, netdev, linux-rdma, linux-kernel
From: Varsha Rao <rvarsha016@gmail.com>
Date: Fri, 1 Jun 2018 07:30:49 +0530
> This patch fixes the clang warning of extraneous parentheses, with the
> following coccinelle script.
...
> Suggested-by: Lukas Bulwahn <lukas.bulwahn@gmail.com>
> Signed-off-by: Varsha Rao <rvarsha016@gmail.com>
Applied to net-next, thanks.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2018-06-04 14:15 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-06-01 2:00 [PATCH] net: ethernet: mlx4: Remove unnecessary parentheses Varsha Rao
2018-06-03 7:15 ` Tariq Toukan
2018-06-04 14:15 ` David Miller
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).