[Intel-gfx] [PATCH 4/4] drm/i915: Rename struct intel_ringbuffer function parameters

Tvrtko Ursulin tvrtko.ursulin at linux.intel.com
Wed Mar 16 15:40:55 UTC 2016


From: Tvrtko Ursulin <tvrtko.ursulin at intel.com>

>From ring to ringbuf so it is always consistent.

Coccinelle script:

@@
identifier func;
identifier r;
@@
func(..., struct intel_ringbuffer *
- r
+ ringbuf
, ...)
{
<...
- r
+ ringbuf
...>
}
@@
identifier func, r;
type T;
@@
T func(..., struct intel_ringbuffer *
- r
+ ringbuf
, ...);

Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin at intel.com>
---
 drivers/gpu/drm/i915/intel_ringbuffer.c | 17 ++++++++++-------
 drivers/gpu/drm/i915/intel_ringbuffer.h |  5 +++--
 2 files changed, 13 insertions(+), 9 deletions(-)

diff --git a/drivers/gpu/drm/i915/intel_ringbuffer.c b/drivers/gpu/drm/i915/intel_ringbuffer.c
index a78a8fae4780..83912011bdb0 100644
--- a/drivers/gpu/drm/i915/intel_ringbuffer.c
+++ b/drivers/gpu/drm/i915/intel_ringbuffer.c
@@ -2135,7 +2135,8 @@ int intel_pin_and_map_ringbuffer_obj(struct drm_device *dev,
 		assert_rpm_wakelock_held(dev_priv);
 
 		ringbuf->virtual_start = ioremap_wc(dev_priv->gtt.mappable_base +
-						    i915_gem_obj_ggtt_offset(obj), ringbuf->size);
+						    i915_gem_obj_ggtt_offset(obj),
+						    ringbuf->size);
 		if (ringbuf->virtual_start == NULL) {
 			i915_gem_object_ggtt_unpin(obj);
 			return -EINVAL;
@@ -2215,11 +2216,11 @@ intel_engine_create_ringbuffer(struct intel_engine_cs *engine, int size)
 }
 
 void
-intel_ringbuffer_free(struct intel_ringbuffer *ring)
+intel_ringbuffer_free(struct intel_ringbuffer *ringbuf)
 {
-	intel_destroy_ringbuffer_obj(ring);
-	list_del(&ring->link);
-	kfree(ring);
+	intel_destroy_ringbuffer_obj(ringbuf);
+	list_del(&ringbuf->link);
+	kfree(ringbuf);
 }
 
 static int intel_init_ring_buffer(struct drm_device *dev,
@@ -2396,7 +2397,8 @@ int intel_ring_reserve_space(struct drm_i915_gem_request *request)
 	return intel_ring_begin(request, 0);
 }
 
-void intel_ring_reserved_space_reserve(struct intel_ringbuffer *ringbuf, int size)
+void intel_ring_reserved_space_reserve(struct intel_ringbuffer *ringbuf,
+				       int size)
 {
 	WARN_ON(ringbuf->reserved_size);
 	WARN_ON(ringbuf->reserved_in_use);
@@ -2426,7 +2428,8 @@ void intel_ring_reserved_space_end(struct intel_ringbuffer *ringbuf)
 	if (ringbuf->tail > ringbuf->reserved_tail) {
 		WARN(ringbuf->tail > ringbuf->reserved_tail + ringbuf->reserved_size,
 		     "request reserved size too small: %d vs %d!\n",
-		     ringbuf->tail - ringbuf->reserved_tail, ringbuf->reserved_size);
+		     ringbuf->tail - ringbuf->reserved_tail,
+		     ringbuf->reserved_size);
 	} else {
 		/*
 		 * The ring was wrapped while the reserved space was in use.
diff --git a/drivers/gpu/drm/i915/intel_ringbuffer.h b/drivers/gpu/drm/i915/intel_ringbuffer.h
index 3e40f7bf2147..f7bbd9d5d6be 100644
--- a/drivers/gpu/drm/i915/intel_ringbuffer.h
+++ b/drivers/gpu/drm/i915/intel_ringbuffer.h
@@ -436,7 +436,7 @@ intel_engine_create_ringbuffer(struct intel_engine_cs *engine, int size);
 int intel_pin_and_map_ringbuffer_obj(struct drm_device *dev,
 				     struct intel_ringbuffer *ringbuf);
 void intel_unpin_ringbuffer_obj(struct intel_ringbuffer *ringbuf);
-void intel_ringbuffer_free(struct intel_ringbuffer *ring);
+void intel_ringbuffer_free(struct intel_ringbuffer *ringbuf);
 
 void intel_stop_engine(struct intel_engine_cs *engine);
 void intel_cleanup_engine(struct intel_engine_cs *engine);
@@ -504,7 +504,8 @@ static inline u32 intel_ring_get_tail(struct intel_ringbuffer *ringbuf)
  * will always have sufficient room to do its stuff. The request creation
  * code calls this automatically.
  */
-void intel_ring_reserved_space_reserve(struct intel_ringbuffer *ringbuf, int size);
+void intel_ring_reserved_space_reserve(struct intel_ringbuffer *ringbuf,
+				       int size);
 /* Cancel the reservation, e.g. because the request is being discarded. */
 void intel_ring_reserved_space_cancel(struct intel_ringbuffer *ringbuf);
 /* Use the reserved space - for use by i915_add_request() only. */
-- 
1.9.1



More information about the Intel-gfx mailing list