public inbox for linux-rdma@vger.kernel.org
 help / color / mirror / Atom feed
From: Saeed Mahameed <saeedm@mellanox.com>
To: "David S. Miller" <davem@davemloft.net>,
	Doug Ledford <dledford@redhat.com>
Cc: netdev@vger.kernel.org, linux-rdma@vger.kernel.org,
	Leon Romanovsky <leonro@mellanox.com>,
	Gal Pressman <galp@mellanox.com>,
	Saeed Mahameed <saeedm@mellanox.com>
Subject: [for-next 09/11] net/mlx5e: E-Switch, Use the name of static array instead of its address
Date: Tue, 19 Dec 2017 12:33:38 -0800	[thread overview]
Message-ID: <20171219203340.2600-10-saeedm@mellanox.com> (raw)
In-Reply-To: <20171219203340.2600-1-saeedm@mellanox.com>

From: Gal Pressman <galp@mellanox.com>

Using the address of a static array is the same as using its name (in
this specific use-case), but it's confusing and makes the code less
readable.

Fixes: 1bd27b11c1df ("net/mlx5: Introduce E-switch QoS management")
Fixes: bd77bf1cb595 ("net/mlx5: Add SRIOV VF max rate configuration support")
Signed-off-by: Gal Pressman <galp@mellanox.com>
Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
---
 drivers/net/ethernet/mellanox/mlx5/core/eswitch.c | 26 +++++++++++------------
 1 file changed, 13 insertions(+), 13 deletions(-)

diff --git a/drivers/net/ethernet/mellanox/mlx5/core/eswitch.c b/drivers/net/ethernet/mellanox/mlx5/core/eswitch.c
index 6d4cbdb69823..cdf65ed8714c 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/eswitch.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/eswitch.c
@@ -1290,7 +1290,7 @@ static int esw_create_tsar(struct mlx5_eswitch *esw)
 
 	err = mlx5_create_scheduling_element_cmd(dev,
 						 SCHEDULING_HIERARCHY_E_SWITCH,
-						 &tsar_ctx,
+						 tsar_ctx,
 						 &esw->qos.root_tsar_id);
 	if (err) {
 		esw_warn(esw->dev, "E-Switch create TSAR failed (%d)\n", err);
@@ -1333,20 +1333,20 @@ static int esw_vport_enable_qos(struct mlx5_eswitch *esw, int vport_num,
 	if (vport->qos.enabled)
 		return -EEXIST;
 
-	MLX5_SET(scheduling_context, &sched_ctx, element_type,
+	MLX5_SET(scheduling_context, sched_ctx, element_type,
 		 SCHEDULING_CONTEXT_ELEMENT_TYPE_VPORT);
-	vport_elem = MLX5_ADDR_OF(scheduling_context, &sched_ctx,
+	vport_elem = MLX5_ADDR_OF(scheduling_context, sched_ctx,
 				  element_attributes);
 	MLX5_SET(vport_element, vport_elem, vport_number, vport_num);
-	MLX5_SET(scheduling_context, &sched_ctx, parent_element_id,
+	MLX5_SET(scheduling_context, sched_ctx, parent_element_id,
 		 esw->qos.root_tsar_id);
-	MLX5_SET(scheduling_context, &sched_ctx, max_average_bw,
+	MLX5_SET(scheduling_context, sched_ctx, max_average_bw,
 		 initial_max_rate);
-	MLX5_SET(scheduling_context, &sched_ctx, bw_share, initial_bw_share);
+	MLX5_SET(scheduling_context, sched_ctx, bw_share, initial_bw_share);
 
 	err = mlx5_create_scheduling_element_cmd(dev,
 						 SCHEDULING_HIERARCHY_E_SWITCH,
-						 &sched_ctx,
+						 sched_ctx,
 						 &vport->qos.esw_tsar_ix);
 	if (err) {
 		esw_warn(esw->dev, "E-Switch create TSAR vport element failed (vport=%d,err=%d)\n",
@@ -1392,22 +1392,22 @@ static int esw_vport_qos_config(struct mlx5_eswitch *esw, int vport_num,
 	if (!vport->qos.enabled)
 		return -EIO;
 
-	MLX5_SET(scheduling_context, &sched_ctx, element_type,
+	MLX5_SET(scheduling_context, sched_ctx, element_type,
 		 SCHEDULING_CONTEXT_ELEMENT_TYPE_VPORT);
-	vport_elem = MLX5_ADDR_OF(scheduling_context, &sched_ctx,
+	vport_elem = MLX5_ADDR_OF(scheduling_context, sched_ctx,
 				  element_attributes);
 	MLX5_SET(vport_element, vport_elem, vport_number, vport_num);
-	MLX5_SET(scheduling_context, &sched_ctx, parent_element_id,
+	MLX5_SET(scheduling_context, sched_ctx, parent_element_id,
 		 esw->qos.root_tsar_id);
-	MLX5_SET(scheduling_context, &sched_ctx, max_average_bw,
+	MLX5_SET(scheduling_context, sched_ctx, max_average_bw,
 		 max_rate);
-	MLX5_SET(scheduling_context, &sched_ctx, bw_share, bw_share);
+	MLX5_SET(scheduling_context, sched_ctx, bw_share, bw_share);
 	bitmask |= MODIFY_SCHEDULING_ELEMENT_IN_MODIFY_BITMASK_MAX_AVERAGE_BW;
 	bitmask |= MODIFY_SCHEDULING_ELEMENT_IN_MODIFY_BITMASK_BW_SHARE;
 
 	err = mlx5_modify_scheduling_element_cmd(dev,
 						 SCHEDULING_HIERARCHY_E_SWITCH,
-						 &sched_ctx,
+						 sched_ctx,
 						 vport->qos.esw_tsar_ix,
 						 bitmask);
 	if (err) {
-- 
2.14.2

  parent reply	other threads:[~2017-12-19 20:33 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-12-19 20:33 [pull request][for-next 00/11] Mellanox, mlx5 E-Switch updates 2017-12-19 Saeed Mahameed
     [not found] ` <20171219203340.2600-1-saeedm-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
2017-12-19 20:33   ` [for-next 01/11] net/mlx5: E-Switch, Refactor vport representors initialization Saeed Mahameed
     [not found]     ` <20171219203340.2600-2-saeedm-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
2017-12-20 17:57       ` David Miller
2017-12-20 19:21         ` Mark Bloch
     [not found]           ` <066d5ac8-e95a-f4ec-fda7-31716242cc05-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
2017-12-20 19:45             ` David Miller
2017-12-19 20:33   ` [for-next 02/11] net/mlx5: E-Switch, Refactor load/unload of representors Saeed Mahameed
2017-12-19 21:54   ` [pull request][for-next 00/11] Mellanox, mlx5 E-Switch updates 2017-12-19 Marcelo Ricardo Leitner
     [not found]     ` <20171219215414.GH6122-bi+AKbBUZKY6gyzm1THtWbp2dZbC/Bob@public.gmane.org>
2017-12-19 22:39       ` Saeed Mahameed
     [not found]         ` <CALzJLG9i4g7c8vKbw7k+o=Pv5GcqWi6AATpOQXj09_KwqvWkmQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2017-12-19 22:46           ` Marcelo Ricardo Leitner
     [not found]             ` <20171219224600.GJ6122-bi+AKbBUZKY6gyzm1THtWbp2dZbC/Bob@public.gmane.org>
2017-12-19 23:36               ` Saeed Mahameed
2017-12-20 17:56   ` David Miller
     [not found]     ` <20171220.125631.1837619997849298593.davem-fT/PcQaiUtIeIZ0/mPfg9Q@public.gmane.org>
2017-12-21  6:19       ` Saeed Mahameed
     [not found]         ` <1513837142.18312.27.camel-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
2017-12-21 15:03           ` David Miller
2017-12-24 11:08             ` Saeed Mahameed
2017-12-19 20:33 ` [for-next 03/11] net/mlx5: E-Switch, Simplify representor load/unload callback API Saeed Mahameed
2017-12-19 20:33 ` [for-next 04/11] net/mlx5: E-Switch, Move mlx5e only logic outside E-Switch Saeed Mahameed
2017-12-19 20:33 ` [for-next 05/11] net/mlx5: E-Switch, Create a dedicated send to vport rule deletion function Saeed Mahameed
2017-12-19 20:33 ` [for-next 06/11] net/mlx5e: Move ethernet representors data into separate struct Saeed Mahameed
2017-12-19 20:33 ` [for-next 07/11] net/mlx5: E-Switch, Create generic header struct to be used by representors Saeed Mahameed
2017-12-20 17:58   ` David Miller
     [not found]     ` <20171220.125858.1378708055295289661.davem-fT/PcQaiUtIeIZ0/mPfg9Q@public.gmane.org>
2017-12-20 19:22       ` Mark Bloch
2017-12-19 20:33 ` [for-next 08/11] net/mlx5e: E-Switch, Move send-to-vport rule struct to en_rep Saeed Mahameed
2017-12-19 20:33 ` Saeed Mahameed [this message]
2017-12-19 20:33 ` [for-next 10/11] net/mlx5: Fix ingress/egress naming mistake Saeed Mahameed
2017-12-19 20:33 ` [for-next 11/11] net/mlx5: Separate ingress/egress namespaces for each vport Saeed Mahameed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20171219203340.2600-10-saeedm@mellanox.com \
    --to=saeedm@mellanox.com \
    --cc=davem@davemloft.net \
    --cc=dledford@redhat.com \
    --cc=galp@mellanox.com \
    --cc=leonro@mellanox.com \
    --cc=linux-rdma@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox