[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250916210823.4033529-10-olvaffe@gmail.com>
Date: Tue, 16 Sep 2025 14:08:22 -0700
From: Chia-I Wu <olvaffe@...il.com>
To: Boris Brezillon <boris.brezillon@...labora.com>,
Steven Price <steven.price@....com>,
Liviu Dudau <liviu.dudau@....com>,
Maarten Lankhorst <maarten.lankhorst@...ux.intel.com>,
Maxime Ripard <mripard@...nel.org>,
Thomas Zimmermann <tzimmermann@...e.de>,
David Airlie <airlied@...il.com>,
Simona Vetter <simona@...ll.ch>,
Grant Likely <grant.likely@...aro.org>,
Heiko Stuebner <heiko@...ech.de>,
dri-devel@...ts.freedesktop.org,
linux-kernel@...r.kernel.org
Subject: [PATCH 09/10] drm/panthor: move size check to mmu_hw_flush_caches
We can early return from mmu_hw_flush_caches when size is 0.
Signed-off-by: Chia-I Wu <olvaffe@...il.com>
---
drivers/gpu/drm/panthor/panthor_mmu.c | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)
diff --git a/drivers/gpu/drm/panthor/panthor_mmu.c b/drivers/gpu/drm/panthor/panthor_mmu.c
index 436a54e30a36d..743e9342eece7 100644
--- a/drivers/gpu/drm/panthor/panthor_mmu.c
+++ b/drivers/gpu/drm/panthor/panthor_mmu.c
@@ -570,9 +570,6 @@ static void mmu_hw_cmd_lock(struct panthor_device *ptdev, u32 as_nr, u64 region_
u64 region;
u64 region_end = region_start + size;
- if (!size)
- return;
-
/*
* The locked region is a naturally aligned power of 2 block encoded as
* log2 minus(1).
@@ -643,7 +640,7 @@ static int mmu_hw_flush_caches(struct panthor_device *ptdev, int as_nr, u64 iova
return -EINVAL;
}
- if (as_nr < 0)
+ if (as_nr < 0 || !size)
return 0;
/*
--
2.51.0.384.g4c02a37b29-goog
Powered by blists - more mailing lists