From: David Francis Date: Thu, 24 May 2018 14:40:12 +0000 (-0400) Subject: drm/amd/display: Remove use of division operator for long longs X-Git-Tag: v5.15~8706^2~2^2 X-Git-Url: https://git.proxmox.com/?a=commitdiff_plain;h=b8f3439fa5358ac84d29fa2f4afa115500dec74c;p=mirror_ubuntu-kernels.git drm/amd/display: Remove use of division operator for long longs In fixed31_32.h, in dc_fixpt_shl,'/' was used for division of one long long int by another long long int. As there is no inbuilt long long int division function in c, gcc inserted its own. However, gcc does not link the library that contains this function. To avoid this, use bitwise operators instead of / Reviewed-by: Alex Deucher Signed-off-by: David Francis Reviewed-by: Dmytro Laktyushkin Signed-off-by: Alex Deucher --- diff --git a/drivers/gpu/drm/amd/display/include/fixed31_32.h b/drivers/gpu/drm/amd/display/include/fixed31_32.h index 76f64e910422..bb0d4ebba9f0 100644 --- a/drivers/gpu/drm/amd/display/include/fixed31_32.h +++ b/drivers/gpu/drm/amd/display/include/fixed31_32.h @@ -209,7 +209,7 @@ static inline struct fixed31_32 dc_fixpt_clamp( static inline struct fixed31_32 dc_fixpt_shl(struct fixed31_32 arg, unsigned char shift) { ASSERT(((arg.value >= 0) && (arg.value <= LLONG_MAX >> shift)) || - ((arg.value < 0) && (arg.value >= (LLONG_MIN / (1LL << shift))))); + ((arg.value < 0) && (arg.value >= ~(LLONG_MAX >> shift)))); arg.value = arg.value << shift;