提交 b8f3439f 编写于 作者: D David Francis 提交者: Alex Deucher

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: NAlex Deucher <alexander.deucher@amd.com>
Signed-off-by: NDavid Francis <David.Francis@amd.com>
Reviewed-by: NDmytro Laktyushkin <Dmytro.Laktyushkin@amd.com>
Signed-off-by: NAlex Deucher <alexander.deucher@amd.com>
上级 f9fb22a2
...@@ -209,7 +209,7 @@ static inline struct fixed31_32 dc_fixpt_clamp( ...@@ -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) static inline struct fixed31_32 dc_fixpt_shl(struct fixed31_32 arg, unsigned char shift)
{ {
ASSERT(((arg.value >= 0) && (arg.value <= LLONG_MAX >> 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; arg.value = arg.value << shift;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册