Commit ef8cf3a1 authored by Akinobu Mita's avatar Akinobu Mita Committed by Dave Airlie

drm/radeon: Use hweight32

Use hweight32 instead of counting for each bit
Signed-off-by: default avatarAkinobu Mita <akinobu.mita@gmail.com>
Cc: David Airlie <airlied@linux.ie>
Cc: dri-devel@lists.freedesktop.org
Signed-off-by: default avatarDave Airlie <airlied@redhat.com>
parent 6311803b
......@@ -1424,13 +1424,7 @@ u32 r6xx_remap_render_backend(struct radeon_device *rdev,
int r600_count_pipe_bits(uint32_t val)
{
int i, ret = 0;
for (i = 0; i < 32; i++) {
ret += val & 1;
val >>= 1;
}
return ret;
return hweight32(val);
}
static void r600_gpu_init(struct radeon_device *rdev)
......
......@@ -721,12 +721,7 @@ static u32 r600_get_tile_pipe_to_backend_map(u32 num_tile_pipes,
static int r600_count_pipe_bits(uint32_t val)
{
int i, ret = 0;
for (i = 0; i < 32; i++) {
ret += val & 1;
val >>= 1;
}
return ret;
return hweight32(val);
}
static void r600_gfx_init(struct drm_device *dev,
......
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