diff mbox series

[-next] drm/i915/gt: Make use of __assign_bit() API

Message ID 20240902131008.2982156-1-lihongbo22@huawei.com (mailing list archive)
State New, archived
Headers show
Series [-next] drm/i915/gt: Make use of __assign_bit() API | expand

Commit Message

Hongbo Li Sept. 2, 2024, 1:10 p.m. UTC
We have for some time the __assign_bit() API to replace
open coded
    if (foo)
        __set_bit(n, bar);
    else
        __clear_bit(n, bar);

Use this API to simplify the code. No functional change
intended.

Signed-off-by: Hongbo Li <lihongbo22@huawei.com>
---
 drivers/gpu/drm/i915/gt/intel_ggtt_fencing.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)
diff mbox series

Patch

diff --git a/drivers/gpu/drm/i915/gt/intel_ggtt_fencing.c b/drivers/gpu/drm/i915/gt/intel_ggtt_fencing.c
index 0ffba50981e3..4380e6f9d0ab 100644
--- a/drivers/gpu/drm/i915/gt/intel_ggtt_fencing.c
+++ b/drivers/gpu/drm/i915/gt/intel_ggtt_fencing.c
@@ -827,10 +827,7 @@  i915_gem_object_save_bit_17_swizzle(struct drm_i915_gem_object *obj,
 	i = 0;
 
 	for_each_sgt_page(page, sgt_iter, pages) {
-		if (page_to_phys(page) & (1 << 17))
-			__set_bit(i, obj->bit_17);
-		else
-			__clear_bit(i, obj->bit_17);
+		__assign_bit(i, obj->bit_17, page_to_phys(page) & (1 << 17));
 		i++;
 	}
 }