Commit 23d433fa authored by Dave Airlie's avatar Dave Airlie Committed by Alex Deucher

amdgpu/dc: use kernel ilog2 for log_2.

This should produce the same result.
Signed-off-by: default avatarDave Airlie <airlied@redhat.com>
Reviewed-by: default avatarHarry Wentland <harry.wentland@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent 4ee67c71
...@@ -102,13 +102,3 @@ void convert_float_matrix( ...@@ -102,13 +102,3 @@ void convert_float_matrix(
matrix[i] = (uint16_t)reg_value; matrix[i] = (uint16_t)reg_value;
} }
} }
unsigned int log_2(unsigned int num)
{
unsigned int result = 0;
while ((num >>= 1) != 0)
result++;
return result;
}
...@@ -38,6 +38,9 @@ void convert_float_matrix( ...@@ -38,6 +38,9 @@ void convert_float_matrix(
struct fixed31_32 *flt, struct fixed31_32 *flt,
uint32_t buffer_size); uint32_t buffer_size);
unsigned int log_2(unsigned int num); static inline unsigned int log_2(unsigned int num)
{
return ilog2(num);
}
#endif #endif
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment