diff options
author | Kees Cook <keescook@chromium.org> | 2018-07-04 13:27:30 -0400 |
---|---|---|
committer | Alex Deucher <alexander.deucher@amd.com> | 2018-07-05 17:40:03 -0400 |
commit | 4c1ac53eb867670883f1518f620b19c2fed7e516 (patch) | |
tree | 66433d6a91be8f93e9fe88637964ff7dec96bd61 /drivers/gpu | |
parent | 25177e7f94a3deeda410edaf9313d0f1a2bb68e0 (diff) |
drm/amd/display: Use 2-factor allocator calls
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>
Diffstat (limited to 'drivers/gpu')
-rw-r--r-- | drivers/gpu/drm/amd/display/modules/color/color_gamma.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/gpu/drm/amd/display/modules/color/color_gamma.c b/drivers/gpu/drm/amd/display/modules/color/color_gamma.c index 98edaefa2b47..ee69c949bfbf 100644 --- a/drivers/gpu/drm/amd/display/modules/color/color_gamma.c +++ b/drivers/gpu/drm/amd/display/modules/color/color_gamma.c | |||
@@ -1723,8 +1723,8 @@ bool mod_color_calculate_curve(enum dc_transfer_func_predefined trans, | |||
1723 | kvfree(rgb_regamma); | 1723 | kvfree(rgb_regamma); |
1724 | } else if (trans == TRANSFER_FUNCTION_HLG || | 1724 | } else if (trans == TRANSFER_FUNCTION_HLG || |
1725 | trans == TRANSFER_FUNCTION_HLG12) { | 1725 | trans == TRANSFER_FUNCTION_HLG12) { |
1726 | rgb_regamma = kvzalloc(sizeof(*rgb_regamma) * | 1726 | rgb_regamma = kvcalloc(MAX_HW_POINTS + _EXTRA_POINTS, |
1727 | (MAX_HW_POINTS + _EXTRA_POINTS), | 1727 | sizeof(*rgb_regamma), |
1728 | GFP_KERNEL); | 1728 | GFP_KERNEL); |
1729 | if (!rgb_regamma) | 1729 | if (!rgb_regamma) |
1730 | goto rgb_regamma_alloc_fail; | 1730 | goto rgb_regamma_alloc_fail; |
@@ -1802,8 +1802,8 @@ bool mod_color_calculate_degamma_curve(enum dc_transfer_func_predefined trans, | |||
1802 | kvfree(rgb_degamma); | 1802 | kvfree(rgb_degamma); |
1803 | } else if (trans == TRANSFER_FUNCTION_HLG || | 1803 | } else if (trans == TRANSFER_FUNCTION_HLG || |
1804 | trans == TRANSFER_FUNCTION_HLG12) { | 1804 | trans == TRANSFER_FUNCTION_HLG12) { |
1805 | rgb_degamma = kvzalloc(sizeof(*rgb_degamma) * | 1805 | rgb_degamma = kvcalloc(MAX_HW_POINTS + _EXTRA_POINTS, |
1806 | (MAX_HW_POINTS + _EXTRA_POINTS), | 1806 | sizeof(*rgb_degamma), |
1807 | GFP_KERNEL); | 1807 | GFP_KERNEL); |
1808 | if (!rgb_degamma) | 1808 | if (!rgb_degamma) |
1809 | goto rgb_degamma_alloc_fail; | 1809 | goto rgb_degamma_alloc_fail; |