[PATCH] net/mlx4_core: make mlx4_profile const

Subsystems: mellanox mlx4 core vpi driver, networking drivers, the rest

STALE3343d

3 messages, 3 authors, 2017-08-24 · open the first message on its own page

[PATCH] net/mlx4_core: make mlx4_profile const

From: Bhumika Goyal <hidden>
Date: 2017-08-23 12:47:53

Make these const as they are only used in a copy operation.

Signed-off-by: Bhumika Goyal <redacted>
---
 drivers/net/ethernet/mellanox/mlx4/main.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/net/ethernet/mellanox/mlx4/main.c b/drivers/net/ethernet/mellanox/mlx4/main.c
index 541ce9e..43fb2eb 100644
--- a/drivers/net/ethernet/mellanox/mlx4/main.c
+++ b/drivers/net/ethernet/mellanox/mlx4/main.c
@@ -121,7 +121,7 @@
 	DRV_NAME ": Mellanox ConnectX core driver v"
 	DRV_VERSION "\n";
 
-static struct mlx4_profile default_profile = {
+static const struct mlx4_profile default_profile = {
 	.num_qp		= 1 << 18,
 	.num_srq	= 1 << 16,
 	.rdmarc_per_qp	= 1 << 4,
@@ -131,7 +131,7 @@
 	.num_mtt	= 1 << 20, /* It is really num mtt segements */
 };
 
-static struct mlx4_profile low_mem_profile = {
+static const struct mlx4_profile low_mem_profile = {
 	.num_qp		= 1 << 17,
 	.num_srq	= 1 << 6,
 	.rdmarc_per_qp	= 1 << 4,
-- 
1.9.1

Re: [PATCH] net/mlx4_core: make mlx4_profile const

From: Tariq Toukan <hidden>
Date: 2017-08-24 09:04:47


On 23/08/2017 3:47 PM, Bhumika Goyal wrote:
quoted hunk
Make these const as they are only used in a copy operation.

Signed-off-by: Bhumika Goyal <redacted>
---
  drivers/net/ethernet/mellanox/mlx4/main.c | 4 ++--
  1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/net/ethernet/mellanox/mlx4/main.c b/drivers/net/ethernet/mellanox/mlx4/main.c
index 541ce9e..43fb2eb 100644
--- a/drivers/net/ethernet/mellanox/mlx4/main.c
+++ b/drivers/net/ethernet/mellanox/mlx4/main.c
@@ -121,7 +121,7 @@
  	DRV_NAME ": Mellanox ConnectX core driver v"
  	DRV_VERSION "\n";
  
-static struct mlx4_profile default_profile = {
+static const struct mlx4_profile default_profile = {
  	.num_qp		= 1 << 18,
  	.num_srq	= 1 << 16,
  	.rdmarc_per_qp	= 1 << 4,
@@ -131,7 +131,7 @@
  	.num_mtt	= 1 << 20, /* It is really num mtt segements */
  };
  
-static struct mlx4_profile low_mem_profile = {
+static const struct mlx4_profile low_mem_profile = {
  	.num_qp		= 1 << 17,
  	.num_srq	= 1 << 6,
  	.rdmarc_per_qp	= 1 << 4,
Thanks Bhumika.

Reviewed-by: Tariq Toukan <redacted>

Re: [PATCH] net/mlx4_core: make mlx4_profile const

From: David Miller <davem@davemloft.net>
Date: 2017-08-24 19:33:51

From: Bhumika Goyal <redacted>
Date: Wed, 23 Aug 2017 18:17:39 +0530
Make these const as they are only used in a copy operation.

Signed-off-by: Bhumika Goyal <redacted>
Applied to net-next.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help