drm/amd/display: Constify static resource_funcs
Subsystems (3)
cover drm/amd/display: Constify static resource_funcs
Constify a couple of instances of resource_funcs that are never modified to allow the compiler to put it in read-only memory.
The other drivers in drivers/gpu/drm/amd/display/dc already have these as const.
Rikard Falkeborn (3):
drm/amd/display: Constify dcn20_res_pool_funcs
drm/amd/display: Constify dcn21_res_pool_funcs
drm/amd/display: Constify dcn30_res_pool_funcs
drivers/gpu/drm/amd/display/dc/dcn20/dcn20_resource.c | 2 +- drivers/gpu/drm/amd/display/dc/dcn21/dcn21_resource.c | 2 +- drivers/gpu/drm/amd/display/dc/dcn30/dcn30_resource.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-)
Signature · 1 line
2.28.0
PATCH 1/3 drm/amd/display: Constify dcn20_res_pool_funcs
The only usage of dcn20_res_pool_funcs is to assign its address to a const pointer. Make it const to allow the compiler to put it in read-only memory.
--- drivers/gpu/drm/amd/display/dc/dcn20/dcn20_resource.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/display/dc/dcn20/dcn20_resource.c +1 -1
@@ -3320,7 +3320,7 @@ enum dc_status dcn20_patch_unknown_plane_state(struct dc_plane_state *plane_statreturn DC_OK ; } -static struct resource_funcs dcn20_res_pool_funcs = { +static const struct resource_funcs dcn20_res_pool_funcs = { .destroy = dcn20_destroy_resource_pool, .link_enc_create = dcn20_link_encoder_create, .panel_cntl_create = dcn20_panel_cntl_create,
Signature · 1 line
2.28.0
PATCH 2/3 drm/amd/display: Constify dcn21_res_pool_funcs
In reply to Rikard FalkebornThe only usage of dcn21_res_pool_funcs is to assign its address to a const pointer. Make it const to allow the compiler to put it in read-only memory.
--- drivers/gpu/drm/amd/display/dc/dcn21/dcn21_resource.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/display/dc/dcn21/dcn21_resource.c +1 -1
@@ -1754,7 +1754,7 @@ enum dc_status dcn21_patch_unknown_plane_state(struct dc_plane_state *plane_statreturn result; } -static struct resource_funcs dcn21_res_pool_funcs = { +static const struct resource_funcs dcn21_res_pool_funcs = { .destroy = dcn21_destroy_resource_pool, .link_enc_create = dcn21_link_encoder_create, .panel_cntl_create = dcn21_panel_cntl_create,
Signature · 1 line
2.28.0
PATCH 3/3 drm/amd/display: Constify dcn30_res_pool_funcs
In reply to Rikard FalkebornThe only usage of dcn30_res_pool_funcs is to assign its address to a const pointer. Make it const to allow the compiler to put it in read-only memory.
--- drivers/gpu/drm/amd/display/dc/dcn30/dcn30_resource.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/display/dc/dcn30/dcn30_resource.c +1 -1
@@ -2412,7 +2412,7 @@ static void dcn30_update_bw_bounding_box(struct dc *dc, struct clk_bw_params *bwdml_init_instance (&dc->current_state->bw_ctx.dml, &dcn3_0_soc, &dcn3_0_ip,DML_PROJECT_DCN30 ); } -static struct resource_funcs dcn30_res_pool_funcs = { +static const struct resource_funcs dcn30_res_pool_funcs = { .destroy = dcn30_destroy_resource_pool, .link_enc_create = dcn30_link_encoder_create, .panel_cntl_create = dcn30_panel_cntl_create,
Signature · 1 line
2.28.0
Alex Deucher
AppliedApplied the series. Thanks!
Alex
Quoted 24 lines · Rikard Falkeborn
Constify a couple of instances of
resource_funcsthat are never modified to allow the compiler to put it in read-only memory.The other drivers in
drivers/gpu/drm/amd/display/dcalready have these as const.Rikard Falkeborn (3):
drm/amd/display: Constifydcn20_res_pool_funcs
drm/amd/display: Constifydcn21_res_pool_funcs
drm/amd/display: Constifydcn30_res_pool_funcsdrivers/gpu/drm/amd/display/dc/dcn20/dcn20_resource.c | 2 +- drivers/gpu/drm/amd/display/dc/dcn21/dcn21_resource.c | 2 +- drivers/gpu/drm/amd/display/dc/dcn30/dcn30_resource.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-)--
2.28.0_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx