Skip to content

Commit

Permalink
drm/amd/display: Remove use of division operator for long longs
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
David Francis authored and Alex Deucher committed May 24, 2018
1 parent f9fb22a commit b8f3439
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/gpu/drm/amd/display/include/fixed31_32.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down

0 comments on commit b8f3439

Please sign in to comment.