drm/amd/display: Remove unnecessary casts in amdgpu_dm_helpers.c
authorSrinivasan Shanmugam <srinivasan.shanmugam@amd.com>
Sat, 24 Jun 2023 04:43:24 +0000 (10:13 +0530)
committerAlex Deucher <alexander.deucher@amd.com>
Fri, 7 Jul 2023 17:51:47 +0000 (13:51 -0400)
Fixes the following category of checkpatch complaints:

WARNING: unnecessary cast may hide bugs, see http://c-faq.com/malloc/mallocnocast.html
+               char *buf = (char *)kvcalloc(total, sizeof(char), GFP_KERNEL);

Cc: Rodrigo Siqueira <Rodrigo.Siqueira@amd.com>
Cc: Aurabindo Pillai <aurabindo.pillai@amd.com>
Signed-off-by: Srinivasan Shanmugam <srinivasan.shanmugam@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_helpers.c

index d9a4829..c13b706 100644 (file)
@@ -426,7 +426,7 @@ void dm_dtn_log_append_v(struct dc_context *ctx,
        total = log_ctx->pos + n + 1;
 
        if (total > log_ctx->size) {
-               char *buf = (char *)kvcalloc(total, sizeof(char), GFP_KERNEL);
+               char *buf = kvcalloc(total, sizeof(char), GFP_KERNEL);
 
                if (buf) {
                        memcpy(buf, log_ctx->buf, log_ctx->pos);