From: Jiri Pirko Date: Sun, 1 Apr 2018 14:34:52 +0000 (+0300) Subject: mlxsw: Constify devlink_resource_ops X-Git-Url: http://git.cdn.openwrt.org/?a=commitdiff_plain;h=f9b9120119ca70ccdb1c900ac061425e4784c4de;p=openwrt%2Fstaging%2Fblogic.git 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 --- 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, };