diff mbox series

[08/15] drm/i915: convert i915_coredump_get/put() to proper functions

Message ID 7953952019a6362acbf8b20372d398b86fbf3a0e.1695924021.git.jani.nikula@intel.com (mailing list archive)
State New, archived
Headers show
Series drm/i915: i915_drv.h and i915_gpu_error.h include diet | expand

Commit Message

Jani Nikula Sept. 28, 2023, 6:08 p.m. UTC
Also make i915_gpu_coredump_get() static, as it's not used outside of
i915_gpu_error.h.

Signed-off-by: Jani Nikula <jani.nikula@intel.com>
---
 drivers/gpu/drm/i915/i915_gpu_error.c | 14 +++++++++++++-
 drivers/gpu/drm/i915/i915_gpu_error.h | 14 +-------------
 2 files changed, 14 insertions(+), 14 deletions(-)
diff mbox series

Patch

diff --git a/drivers/gpu/drm/i915/i915_gpu_error.c b/drivers/gpu/drm/i915/i915_gpu_error.c
index 17699b20694c..9b1bb5aeec11 100644
--- a/drivers/gpu/drm/i915/i915_gpu_error.c
+++ b/drivers/gpu/drm/i915/i915_gpu_error.c
@@ -1060,7 +1060,7 @@  static void cleanup_gt(struct intel_gt_coredump *gt)
 	kfree(gt);
 }
 
-void __i915_gpu_coredump_free(struct kref *error_ref)
+static void i915_gpu_coredump_free(struct kref *error_ref)
 {
 	struct i915_gpu_coredump *error =
 		container_of(error_ref, typeof(*error), ref);
@@ -1080,6 +1080,18 @@  void __i915_gpu_coredump_free(struct kref *error_ref)
 	kfree(error);
 }
 
+static struct i915_gpu_coredump *i915_gpu_coredump_get(struct i915_gpu_coredump *gpu)
+{
+	kref_get(&gpu->ref);
+	return gpu;
+}
+
+void i915_gpu_coredump_put(struct i915_gpu_coredump *gpu)
+{
+	if (gpu)
+		kref_put(&gpu->ref, i915_gpu_coredump_free);
+}
+
 static struct i915_vma_coredump *
 i915_vma_coredump_create(const struct intel_gt *gt,
 			 const struct i915_vma_resource *vma_res,
diff --git a/drivers/gpu/drm/i915/i915_gpu_error.h b/drivers/gpu/drm/i915/i915_gpu_error.h
index 68c964d6720a..f6f8d284a07d 100644
--- a/drivers/gpu/drm/i915/i915_gpu_error.h
+++ b/drivers/gpu/drm/i915/i915_gpu_error.h
@@ -305,23 +305,11 @@  void i915_vma_capture_finish(struct intel_gt_coredump *gt,
 
 void i915_error_state_store(struct i915_gpu_coredump *error);
 
-static inline struct i915_gpu_coredump *
-i915_gpu_coredump_get(struct i915_gpu_coredump *gpu)
-{
-	kref_get(&gpu->ref);
-	return gpu;
-}
-
 ssize_t
 i915_gpu_coredump_copy_to_buffer(struct i915_gpu_coredump *error,
 				 char *buf, loff_t offset, size_t count);
 
-void __i915_gpu_coredump_free(struct kref *kref);
-static inline void i915_gpu_coredump_put(struct i915_gpu_coredump *gpu)
-{
-	if (gpu)
-		kref_put(&gpu->ref, __i915_gpu_coredump_free);
-}
+void i915_gpu_coredump_put(struct i915_gpu_coredump *gpu);
 
 void i915_reset_error_state(struct drm_i915_private *i915);
 void i915_disable_error_state(struct drm_i915_private *i915, int err);