[PATCH] drm/i915: Micro-optimise i915_request_retire()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I caught the compiler emitting the if(!NULL) guard at the start of
dma_fence_put(); on the request it should know for certain is already
non-NULL. Mark up the function as non-null and tell the compiler that
the request pointer doesn't change:

add/remove: 0/0 grow/shrink: 0/1 up/down: 0/-5 (-5)
Function                                     old     new   delta
i915_request_retire                         1782    1777      -5

Signed-off-by: Chris Wilson <chris@xxxxxxxxxxxxxxxxxx>
Cc: Tvrtko Ursulin <tvrtko.ursulin@xxxxxxxxx>
---
 drivers/gpu/drm/i915/i915_request.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/i915/i915_request.c b/drivers/gpu/drm/i915/i915_request.c
index 3bcb75742110..d54c99211c8c 100644
--- a/drivers/gpu/drm/i915/i915_request.c
+++ b/drivers/gpu/drm/i915/i915_request.c
@@ -405,7 +405,8 @@ static void __retire_engine_upto(struct intel_engine_cs *engine,
 	} while (tmp != rq);
 }
 
-static void i915_request_retire(struct i915_request *request)
+__attribute__((nonnull))
+static void i915_request_retire(struct i915_request * const request)
 {
 	struct i915_gem_active *active, *next;
 
-- 
2.17.0

_______________________________________________
Intel-gfx mailing list
Intel-gfx@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/intel-gfx




[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]
  Powered by Linux