dri-devel.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] Covert to use time_before macro
@ 2023-07-06  6:46 Zehao Zhang
  2023-07-06  7:39 ` Zehao Zhang
  0 siblings, 1 reply; 2+ messages in thread
From: Zehao Zhang @ 2023-07-06  6:46 UTC (permalink / raw)
  To: jani.nikula, joonas.lahtinen, rodrigo.vivi, tvrtko.ursulin,
	airlied, daniel, zhangzehao, luciano.coelho
  Cc: intel-gfx, linux-kernel, dri-devel

Use time_before macro instead of open it for readability.

Signed-off-by: Zehao Zhang <zhangzehao@vivo.com>
---
 drivers/gpu/drm/i915/gt/intel_gt_buffer_pool.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/i915/gt/intel_gt_buffer_pool.c b/drivers/gpu/drm/i915/gt/intel_gt_buffer_pool.c
index 86b5a9ba323d..9145f9e22860 100644
--- a/drivers/gpu/drm/i915/gt/intel_gt_buffer_pool.c
+++ b/drivers/gpu/drm/i915/gt/intel_gt_buffer_pool.c
@@ -57,7 +57,7 @@ static bool pool_free_older_than(struct intel_gt_buffer_pool *pool, long keep)
 				node = list_entry(pos, typeof(*node), link);
 
 				age = READ_ONCE(node->age);
-				if (!age || jiffies - age < keep)
+				if (!age || time_before(jiffies, age + keep))
 					break;
 
 				/* Check we are the first to claim this node */
-- 
2.35.3


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] Covert to use time_before macro
  2023-07-06  6:46 [PATCH] Covert to use time_before macro Zehao Zhang
@ 2023-07-06  7:39 ` Zehao Zhang
  0 siblings, 0 replies; 2+ messages in thread
From: Zehao Zhang @ 2023-07-06  7:39 UTC (permalink / raw)
  To: Zehao Zhang, jani.nikula, joonas.lahtinen, rodrigo.vivi,
	tvrtko.ursulin, airlied, daniel, luciano.coelho
  Cc: intel-gfx, linux-kernel, dri-devel

[-- Attachment #1: Type: text/plain, Size: 112 bytes --]

Correct the format of the Subject in v2:
https://lore.kernel.org/all/20230706072924.2562-1-zhangzehao@vivo.com/

[-- Attachment #2: Type: text/html, Size: 362 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2023-07-06  9:07 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-07-06  6:46 [PATCH] Covert to use time_before macro Zehao Zhang
2023-07-06  7:39 ` Zehao Zhang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).