drm/amd/display: Fix unnecessary cast warnings from checkpatch
authorRohit Chavan <roheetchavan@gmail.com>
Tue, 17 Sep 2024 16:31:19 +0000 (22:01 +0530)
committerAlex Deucher <alexander.deucher@amd.com>
Thu, 26 Sep 2024 21:06:17 +0000 (17:06 -0400)
This patch addresses warnings produced by the checkpatch script
related to unnecessary casts that could potentially hide bugs.

The specific warnings are as follows:
- Warning at drivers/gpu/drm/amd/display/dc/dml2/dml21/dml21_wrapper.c:16
- Warning at drivers/gpu/drm/amd/display/dc/dml2/dml21/dml21_wrapper.c:20
- Warning at drivers/gpu/drm/amd/display/dc/dml2/dml21/dml21_wrapper.c:30

Acked-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Rohit Chavan <roheetchavan@gmail.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/display/dc/dml2/dml21/dml21_wrapper.c

index d35dd507cb9f8596148e4c4080676eab39cecdac..bbc28b9a15a36dd53a4ad09af3ec0bb3564029ad 100644 (file)
 
 static bool dml21_allocate_memory(struct dml2_context **dml_ctx)
 {
-       *dml_ctx = (struct dml2_context *)kzalloc(sizeof(struct dml2_context), GFP_KERNEL);
+       *dml_ctx = kzalloc(sizeof(struct dml2_context), GFP_KERNEL);
        if (!(*dml_ctx))
                return false;
 
-       (*dml_ctx)->v21.dml_init.dml2_instance = (struct dml2_instance *)kzalloc(sizeof(struct dml2_instance), GFP_KERNEL);
+       (*dml_ctx)->v21.dml_init.dml2_instance = kzalloc(sizeof(struct dml2_instance), GFP_KERNEL);
        if (!((*dml_ctx)->v21.dml_init.dml2_instance))
                return false;
 
@@ -27,7 +27,7 @@ static bool dml21_allocate_memory(struct dml2_context **dml_ctx)
        (*dml_ctx)->v21.mode_support.display_config = &(*dml_ctx)->v21.display_config;
        (*dml_ctx)->v21.mode_programming.display_config = (*dml_ctx)->v21.mode_support.display_config;
 
-       (*dml_ctx)->v21.mode_programming.programming = (struct dml2_display_cfg_programming *)kzalloc(sizeof(struct dml2_display_cfg_programming), GFP_KERNEL);
+       (*dml_ctx)->v21.mode_programming.programming = kzalloc(sizeof(struct dml2_display_cfg_programming), GFP_KERNEL);
        if (!((*dml_ctx)->v21.mode_programming.programming))
                return false;