From f9b9120119ca70ccdb1c900ac061425e4784c4de Mon Sep 17 00:00:00 2001 From: Jiri Pirko Date: Sun, 1 Apr 2018 17:34:52 +0300 Subject: [PATCH] mlxsw: Constify devlink_resource_ops devlink_resource_ops should be const as the arg of register function is also const. Signed-off-by: Jiri Pirko Signed-off-by: Ido Schimmel Signed-off-by: David S. Miller --- drivers/net/ethernet/mellanox/mlxsw/spectrum.c | 2 +- drivers/net/ethernet/mellanox/mlxsw/spectrum_kvdl.c | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum.c b/drivers/net/ethernet/mellanox/mlxsw/spectrum.c index 4aa84442e357..0e9ed41ce8bc 100644 --- a/drivers/net/ethernet/mellanox/mlxsw/spectrum.c +++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum.c @@ -3815,7 +3815,7 @@ static u64 mlxsw_sp_resource_kvd_linear_occ_get(struct devlink *devlink) return mlxsw_sp_kvdl_occ_get(mlxsw_sp); } -static struct devlink_resource_ops mlxsw_sp_resource_kvd_linear_ops = { +static const struct devlink_resource_ops mlxsw_sp_resource_kvd_linear_ops = { .occ_get = mlxsw_sp_resource_kvd_linear_occ_get, }; diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum_kvdl.c b/drivers/net/ethernet/mellanox/mlxsw/spectrum_kvdl.c index 9e61518c4945..201825c0019b 100644 --- a/drivers/net/ethernet/mellanox/mlxsw/spectrum_kvdl.c +++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum_kvdl.c @@ -408,15 +408,15 @@ static u64 mlxsw_sp_kvdl_large_chunks_occ_get(struct devlink *devlink) return mlxsw_sp_kvdl_part_occ(part); } -static struct devlink_resource_ops mlxsw_sp_kvdl_single_ops = { +static const struct devlink_resource_ops mlxsw_sp_kvdl_single_ops = { .occ_get = mlxsw_sp_kvdl_single_occ_get, }; -static struct devlink_resource_ops mlxsw_sp_kvdl_chunks_ops = { +static const struct devlink_resource_ops mlxsw_sp_kvdl_chunks_ops = { .occ_get = mlxsw_sp_kvdl_chunks_occ_get, }; -static struct devlink_resource_ops mlxsw_sp_kvdl_chunks_large_ops = { +static const struct devlink_resource_ops mlxsw_sp_kvdl_chunks_large_ops = { .occ_get = mlxsw_sp_kvdl_large_chunks_occ_get, }; -- 2.30.2