summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/radeon/r600.c
diff options
context:
space:
mode:
authorAkinobu Mita <akinobu.mita@gmail.com>2012-11-09 12:10:41 (GMT)
committerDave Airlie <airlied@redhat.com>2012-11-20 06:06:18 (GMT)
commitef8cf3a1c523afa499d15856e7db3844ad59d1fb (patch)
tree998f1c1afed540a6df8c8f61d5f58e32f70d9665 /drivers/gpu/drm/radeon/r600.c
parent6311803b1294432ee680fec5e628efae0d485fa2 (diff)
downloadlinux-fsl-qoriq-ef8cf3a1c523afa499d15856e7db3844ad59d1fb.tar.xz
drm/radeon: Use hweight32
Use hweight32 instead of counting for each bit Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com> Cc: David Airlie <airlied@linux.ie> Cc: dri-devel@lists.freedesktop.org Signed-off-by: Dave Airlie <airlied@redhat.com>
Diffstat (limited to 'drivers/gpu/drm/radeon/r600.c')
-rw-r--r--drivers/gpu/drm/radeon/r600.c8
1 files changed, 1 insertions, 7 deletions
diff --git a/drivers/gpu/drm/radeon/r600.c b/drivers/gpu/drm/radeon/r600.c
index cda280d..169ecc9 100644
--- a/drivers/gpu/drm/radeon/r600.c
+++ b/drivers/gpu/drm/radeon/r600.c
@@ -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)