Re: [PATCH 1/6] drm/amd/display: Remove unnecessary casts in amdgpu_dm_helpers.c

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Reviewed-by: Alex Deucher <alexander.deucher@xxxxxxx>

On Thu, Jun 29, 2023 at 12:47 AM Srinivasan Shanmugam
<srinivasan.shanmugam@xxxxxxx> wrote:
>
> 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@xxxxxxx>
> Cc: Aurabindo Pillai <aurabindo.pillai@xxxxxxx>
> Signed-off-by: Srinivasan Shanmugam <srinivasan.shanmugam@xxxxxxx>
> Reviewed-by: Christian König <christian.koenig@xxxxxxx>
> ---
>  drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_helpers.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_helpers.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_helpers.c
> index d9a482908380..c13b70629be6 100644
> --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_helpers.c
> +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_helpers.c
> @@ -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);
> --
> 2.25.1
>




[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux