drm/amd/display: remove unnecessary cast and use kcalloc instead of kzalloc
authorColin Ian King <colin.king@canonical.com>
Wed, 15 Nov 2017 15:45:09 +0000 (15:45 +0000)
committerAlex Deucher <alexander.deucher@amd.com>
Wed, 6 Dec 2017 17:47:55 +0000 (12:47 -0500)
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>
drivers/gpu/drm/amd/display/dc/basics/logger.c

index e04e8ecd48748093863f05581e5b37d1b8af6c5f..2ff5b467603dee7570473be5d98b2bddfa6c6077 100644 (file)
@@ -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;