linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] mlxsw: make mlxsw_config_profile const
@ 2017-08-11 13:40 Bhumika Goyal
  2017-08-11 15:32 ` Jiri Pirko
  2017-08-11 21:57 ` David Miller
  0 siblings, 2 replies; 3+ messages in thread
From: Bhumika Goyal @ 2017-08-11 13:40 UTC (permalink / raw)
  To: julia.lawall, jiri, idosch, netdev, linux-kernel; +Cc: Bhumika Goyal

Make these structures const as they only stored in the profile field of
a mlxsw_driver structure, which is of type const.
Done using Coccinelle.

Signed-off-by: Bhumika Goyal <bhumirks@gmail.com>
---
 drivers/net/ethernet/mellanox/mlxsw/spectrum.c | 2 +-
 drivers/net/ethernet/mellanox/mlxsw/switchib.c | 2 +-
 drivers/net/ethernet/mellanox/mlxsw/switchx2.c | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum.c b/drivers/net/ethernet/mellanox/mlxsw/spectrum.c
index eb7c454..82f8ccd 100644
--- a/drivers/net/ethernet/mellanox/mlxsw/spectrum.c
+++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum.c
@@ -3743,7 +3743,7 @@ static void mlxsw_sp_fini(struct mlxsw_core *mlxsw_core)
 	mlxsw_sp_fids_fini(mlxsw_sp);
 }
 
-static struct mlxsw_config_profile mlxsw_sp_config_profile = {
+static const struct mlxsw_config_profile mlxsw_sp_config_profile = {
 	.used_max_vepa_channels		= 1,
 	.max_vepa_channels		= 0,
 	.used_max_mid			= 1,
diff --git a/drivers/net/ethernet/mellanox/mlxsw/switchib.c b/drivers/net/ethernet/mellanox/mlxsw/switchib.c
index 74341fe..ab7a298 100644
--- a/drivers/net/ethernet/mellanox/mlxsw/switchib.c
+++ b/drivers/net/ethernet/mellanox/mlxsw/switchib.c
@@ -497,7 +497,7 @@ static void mlxsw_sib_fini(struct mlxsw_core *mlxsw_core)
 	mlxsw_sib_ports_remove(mlxsw_sib);
 }
 
-static struct mlxsw_config_profile mlxsw_sib_config_profile = {
+static const struct mlxsw_config_profile mlxsw_sib_config_profile = {
 	.used_max_system_port		= 1,
 	.max_system_port		= 48000,
 	.used_max_ib_mc			= 1,
diff --git a/drivers/net/ethernet/mellanox/mlxsw/switchx2.c b/drivers/net/ethernet/mellanox/mlxsw/switchx2.c
index 3b0f724..f3c29bb 100644
--- a/drivers/net/ethernet/mellanox/mlxsw/switchx2.c
+++ b/drivers/net/ethernet/mellanox/mlxsw/switchx2.c
@@ -1674,7 +1674,7 @@ static void mlxsw_sx_fini(struct mlxsw_core *mlxsw_core)
 	mlxsw_sx_ports_remove(mlxsw_sx);
 }
 
-static struct mlxsw_config_profile mlxsw_sx_config_profile = {
+static const struct mlxsw_config_profile mlxsw_sx_config_profile = {
 	.used_max_vepa_channels		= 1,
 	.max_vepa_channels		= 0,
 	.used_max_mid			= 1,
-- 
1.9.1

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

* Re: [PATCH] mlxsw: make mlxsw_config_profile const
  2017-08-11 13:40 [PATCH] mlxsw: make mlxsw_config_profile const Bhumika Goyal
@ 2017-08-11 15:32 ` Jiri Pirko
  2017-08-11 21:57 ` David Miller
  1 sibling, 0 replies; 3+ messages in thread
From: Jiri Pirko @ 2017-08-11 15:32 UTC (permalink / raw)
  To: Bhumika Goyal; +Cc: julia.lawall, jiri, idosch, netdev, linux-kernel

Fri, Aug 11, 2017 at 03:40:42PM CEST, bhumirks@gmail.com wrote:
>Make these structures const as they only stored in the profile field of
>a mlxsw_driver structure, which is of type const.
>Done using Coccinelle.
>
>Signed-off-by: Bhumika Goyal <bhumirks@gmail.com>

Acked-by: Jiri Pirko <jiri@mellanox.com>

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

* Re: [PATCH] mlxsw: make mlxsw_config_profile const
  2017-08-11 13:40 [PATCH] mlxsw: make mlxsw_config_profile const Bhumika Goyal
  2017-08-11 15:32 ` Jiri Pirko
@ 2017-08-11 21:57 ` David Miller
  1 sibling, 0 replies; 3+ messages in thread
From: David Miller @ 2017-08-11 21:57 UTC (permalink / raw)
  To: bhumirks; +Cc: julia.lawall, jiri, idosch, netdev, linux-kernel

From: Bhumika Goyal <bhumirks@gmail.com>
Date: Fri, 11 Aug 2017 19:10:42 +0530

> Make these structures const as they only stored in the profile field of
> a mlxsw_driver structure, which is of type const.
> Done using Coccinelle.
> 
> Signed-off-by: Bhumika Goyal <bhumirks@gmail.com>

Applied to net-next.

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

end of thread, other threads:[~2017-08-11 21:57 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-08-11 13:40 [PATCH] mlxsw: make mlxsw_config_profile const Bhumika Goyal
2017-08-11 15:32 ` Jiri Pirko
2017-08-11 21:57 ` 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).