[PATCH 2/3] drm/amd/amdgpu: Simplify mask creation in gfx6

Tom St Denis tstdenis82 at gmail.com
Thu Sep 1 17:44:46 UTC 2016


Signed-off-by: Tom St Denis <tom.stdenis at amd.com>
---
 drivers/gpu/drm/amd/amdgpu/gfx_v6_0.c | 8 +-------
 1 file changed, 1 insertion(+), 7 deletions(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/gfx_v6_0.c b/drivers/gpu/drm/amd/amdgpu/gfx_v6_0.c
index 099539f0fa53..5f508c96496f 100644
--- a/drivers/gpu/drm/amd/amdgpu/gfx_v6_0.c
+++ b/drivers/gpu/drm/amd/amdgpu/gfx_v6_0.c
@@ -911,13 +911,7 @@ static void gfx_v6_0_select_se_sh(struct amdgpu_device *adev, u32 se_num,
 
 static u32 gfx_v6_0_create_bitmask(u32 bit_width)
 {
-	u32 i, mask = 0;
-
-	for (i = 0; i < bit_width; i++) {
-		mask <<= 1;
-		mask |= 1;
-	}
-	return mask;
+	return (u32)(((u64)1 << bit_width) - 1);
 }
 
 static u32 gfx_v6_0_get_rb_disabled(struct amdgpu_device *adev,
-- 
2.9.3



More information about the amd-gfx mailing list