diff mbox series

[v5,3/4] drm/i915/selftests: use nop_clear_range instead of local function

Message ID 20230308-guard_error_capture-v5-3-6d1410d13540@intel.com (mailing list archive)
State New, archived
Headers show
Series drm/i915: add guard page to ggtt->error_capture | expand

Commit Message

Andrzej Hajda March 8, 2023, 3:39 p.m. UTC
Since nop_clear_range is visible it can be used here.

Signed-off-by: Andrzej Hajda <andrzej.hajda@intel.com>
---
 drivers/gpu/drm/i915/selftests/mock_gtt.c | 9 ++-------
 1 file changed, 2 insertions(+), 7 deletions(-)

Comments

Andi Shyti March 9, 2023, 12:02 a.m. UTC | #1
Hi Andrzej,

On Wed, Mar 08, 2023 at 04:39:05PM +0100, Andrzej Hajda wrote:
> Since nop_clear_range is visible it can be used here.
> 
> Signed-off-by: Andrzej Hajda <andrzej.hajda@intel.com>

Reviewed-by: Andi Shyti <andi.shyti@linux.intel.com>

Thanks,
Andi
diff mbox series

Patch

diff --git a/drivers/gpu/drm/i915/selftests/mock_gtt.c b/drivers/gpu/drm/i915/selftests/mock_gtt.c
index ece97e4faacb97..89119e3970279f 100644
--- a/drivers/gpu/drm/i915/selftests/mock_gtt.c
+++ b/drivers/gpu/drm/i915/selftests/mock_gtt.c
@@ -57,11 +57,6 @@  static void mock_cleanup(struct i915_address_space *vm)
 {
 }
 
-static void mock_clear_range(struct i915_address_space *vm,
-			     u64 start, u64 length)
-{
-}
-
 struct i915_ppgtt *mock_ppgtt(struct drm_i915_private *i915, const char *name)
 {
 	struct i915_ppgtt *ppgtt;
@@ -80,7 +75,7 @@  struct i915_ppgtt *mock_ppgtt(struct drm_i915_private *i915, const char *name)
 	ppgtt->vm.alloc_pt_dma = alloc_pt_dma;
 	ppgtt->vm.alloc_scratch_dma = alloc_pt_dma;
 
-	ppgtt->vm.clear_range = mock_clear_range;
+	ppgtt->vm.clear_range = nop_clear_range;
 	ppgtt->vm.insert_page = mock_insert_page;
 	ppgtt->vm.insert_entries = mock_insert_entries;
 	ppgtt->vm.cleanup = mock_cleanup;
@@ -119,7 +114,7 @@  void mock_init_ggtt(struct intel_gt *gt)
 	ggtt->vm.alloc_pt_dma = alloc_pt_dma;
 	ggtt->vm.alloc_scratch_dma = alloc_pt_dma;
 
-	ggtt->vm.clear_range = mock_clear_range;
+	ggtt->vm.clear_range = nop_clear_range;
 	ggtt->vm.insert_page = mock_insert_page;
 	ggtt->vm.insert_entries = mock_insert_entries;
 	ggtt->vm.cleanup = mock_cleanup;