drm/amd/display: Use 2-factor allocator calls
authorKees Cook <keescook@chromium.org>
Wed, 4 Jul 2018 17:27:30 +0000 (10:27 -0700)
committerAlex Deucher <alexander.deucher@amd.com>
Thu, 5 Jul 2018 21:40:03 +0000 (16:40 -0500)
As already done treewide, switch from open-coded multiplication to
2-factor allocation helper.

Signed-off-by: Kees Cook <keescook@chromium.org>
Reviewed-by: Harry Wentland <harry.wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/display/modules/color/color_gamma.c

index 98edaefa2b472d75299df4c32600feeec8bab9ee..ee69c949bfbf2d7d165fe388dc128b38916c4105 100644 (file)
@@ -1723,8 +1723,8 @@ bool  mod_color_calculate_curve(enum dc_transfer_func_predefined trans,
                kvfree(rgb_regamma);
        } else if (trans == TRANSFER_FUNCTION_HLG ||
                trans == TRANSFER_FUNCTION_HLG12) {
-               rgb_regamma = kvzalloc(sizeof(*rgb_regamma) *
-                                      (MAX_HW_POINTS + _EXTRA_POINTS),
+               rgb_regamma = kvcalloc(MAX_HW_POINTS + _EXTRA_POINTS,
+                                      sizeof(*rgb_regamma),
                                       GFP_KERNEL);
                if (!rgb_regamma)
                        goto rgb_regamma_alloc_fail;
@@ -1802,8 +1802,8 @@ bool  mod_color_calculate_degamma_curve(enum dc_transfer_func_predefined trans,
                kvfree(rgb_degamma);
        } else if (trans == TRANSFER_FUNCTION_HLG ||
                trans == TRANSFER_FUNCTION_HLG12) {
-               rgb_degamma = kvzalloc(sizeof(*rgb_degamma) *
-                                      (MAX_HW_POINTS + _EXTRA_POINTS),
+               rgb_degamma = kvcalloc(MAX_HW_POINTS + _EXTRA_POINTS,
+                                      sizeof(*rgb_degamma),
                                       GFP_KERNEL);
                if (!rgb_degamma)
                        goto rgb_degamma_alloc_fail;