aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorDavid Francis <David.Francis@amd.com>2018-05-24 10:40:12 -0400
committerAlex Deucher <alexander.deucher@amd.com>2018-05-24 11:07:56 -0400
commitb8f3439fa5358ac84d29fa2f4afa115500dec74c (patch)
tree921d7433eb3c3b39f4ca56e4445eeb26f0e78e23 /drivers
parentf9fb22a21b380b14f70048fe719875e3523ac7d8 (diff)
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 <alexander.deucher@amd.com> Signed-off-by: David Francis <David.Francis@amd.com> Reviewed-by: Dmytro Laktyushkin <Dmytro.Laktyushkin@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/gpu/drm/amd/display/include/fixed31_32.h2
1 files changed, 1 insertions, 1 deletions
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(
209static inline struct fixed31_32 dc_fixpt_shl(struct fixed31_32 arg, unsigned char shift) 209static inline struct fixed31_32 dc_fixpt_shl(struct fixed31_32 arg, unsigned char shift)
210{ 210{
211 ASSERT(((arg.value >= 0) && (arg.value <= LLONG_MAX >> shift)) || 211 ASSERT(((arg.value >= 0) && (arg.value <= LLONG_MAX >> shift)) ||
212 ((arg.value < 0) && (arg.value >= (LLONG_MIN / (1LL << shift))))); 212 ((arg.value < 0) && (arg.value >= ~(LLONG_MAX >> shift))));
213 213
214 arg.value = arg.value << shift; 214 arg.value = arg.value << shift;
215 215