[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CADnq5_P=poTAQkpxY8qwKGMyphbJzYOT8FKF=NnR-LkQP8Z8HQ@mail.gmail.com>
Date: Thu, 16 Nov 2017 16:38:46 -0500
From: Alex Deucher <alexdeucher@...il.com>
To: Colin King <colin.king@...onical.com>
Cc: Alex Deucher <alexander.deucher@....com>,
Christian König <christian.koenig@....com>,
David Airlie <airlied@...ux.ie>,
Harry Wentland <harry.wentland@....com>,
Tony Cheng <tony.cheng@....com>,
amd-gfx list <amd-gfx@...ts.freedesktop.org>,
Maling list - DRI developers
<dri-devel@...ts.freedesktop.org>, kernel-janitors@...r.kernel.org,
LKML <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] drm/amd/display: remove unnecessary cast and use kcalloc
instead of kzalloc
On Wed, Nov 15, 2017 at 10:45 AM, Colin King <colin.king@...onical.com> wrote:
> From: Colin Ian King <colin.king@...onical.com>
>
> Use kcalloc instead of kzalloc and the cast on the return from kzalloc is
> unnecessary and can be removed.
>
> Signed-off-by: Colin Ian King <colin.king@...onical.com>
Reviewed and pushed.
Thanks!
Alex
> ---
> drivers/gpu/drm/amd/display/dc/basics/logger.c | 5 ++---
> 1 file changed, 2 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/display/dc/basics/logger.c b/drivers/gpu/drm/amd/display/dc/basics/logger.c
> index e04e8ecd4874..2ff5b467603d 100644
> --- a/drivers/gpu/drm/amd/display/dc/basics/logger.c
> +++ b/drivers/gpu/drm/amd/display/dc/basics/logger.c
> @@ -70,9 +70,8 @@ static bool construct(struct dc_context *ctx, struct dal_logger *logger,
> {
> /* malloc buffer and init offsets */
> logger->log_buffer_size = DAL_LOGGER_BUFFER_MAX_SIZE;
> - logger->log_buffer = (char *)kzalloc(logger->log_buffer_size * sizeof(char),
> - GFP_KERNEL);
> -
> + logger->log_buffer = kcalloc(logger->log_buffer_size, sizeof(char),
> + GFP_KERNEL);
> if (!logger->log_buffer)
> return false;
>
> --
> 2.14.1
>
> _______________________________________________
> dri-devel mailing list
> dri-devel@...ts.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel
Powered by blists - more mailing lists