From: Colin Ian King <colin.king@canonical.com>
Date: Wed, 15 Nov 2017 15:45:09 +0000
Subject: drm/amd/display: remove unnecessary cast and use kcalloc instead of
kzalloc
Git-commit: e778c1319b627e1aabd7aa00757eb50f593fbfa3
Patch-mainline: v4.16-rc1
References: FATE#326289 FATE#326079 FATE#326049 FATE#322398 FATE#326166
Use kcalloc instead of kzalloc and the cast on the return from kzalloc is
unnecessary and can be removed.
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Acked-by: Petr Tesarik <ptesarik@suse.com>
---
drivers/gpu/drm/amd/display/dc/basics/logger.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
--- 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
{
/* 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;