Explorar o código

drm/amd/display: remove unnecessary cast and use kcalloc instead of kzalloc

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>
Colin Ian King %!s(int64=7) %!d(string=hai) anos
pai
achega
e778c1319b
Modificáronse 1 ficheiros con 2 adicións e 3 borrados
  1. 2 3
      drivers/gpu/drm/amd/display/dc/basics/logger.c

+ 2 - 3
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;