public inbox for intel-gfx@lists.freedesktop.org
 help / color / mirror / Atom feed
* [Intel-gfx] [PATCH] drm/i915/selftests: fix a couple IS_ERR() vs NULL tests
@ 2022-07-08  8:40 Dan Carpenter
  2022-07-08  9:02 ` Matthew Auld
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Dan Carpenter @ 2022-07-08  8:40 UTC (permalink / raw)
  To: Jani Nikula, Chris Wilson
  Cc: Michał Winiarski, David Airlie, intel-gfx, kernel-janitors,
	Matthew Auld, Rodrigo Vivi

The shmem_pin_map() function doesn't return error pointers, it returns
NULL.

Fixes: a0d3fdb628b8 ("drm/i915/gt: Split logical ring contexts from execlist submission"
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
---
 drivers/gpu/drm/i915/gt/selftest_lrc.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/gpu/drm/i915/gt/selftest_lrc.c b/drivers/gpu/drm/i915/gt/selftest_lrc.c
index 8b2c11dbe354..1109088fe8f6 100644
--- a/drivers/gpu/drm/i915/gt/selftest_lrc.c
+++ b/drivers/gpu/drm/i915/gt/selftest_lrc.c
@@ -176,8 +176,8 @@ static int live_lrc_layout(void *arg)
 			continue;
 
 		hw = shmem_pin_map(engine->default_state);
-		if (IS_ERR(hw)) {
-			err = PTR_ERR(hw);
+		if (!hw) {
+			err = -ENOMEM;
 			break;
 		}
 		hw += LRC_STATE_OFFSET / sizeof(*hw);
@@ -365,8 +365,8 @@ static int live_lrc_fixed(void *arg)
 			continue;
 
 		hw = shmem_pin_map(engine->default_state);
-		if (IS_ERR(hw)) {
-			err = PTR_ERR(hw);
+		if (!hw) {
+			err = -ENOMEM;
 			break;
 		}
 		hw += LRC_STATE_OFFSET / sizeof(*hw);
-- 
2.35.1


^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2022-07-08 20:01 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-07-08  8:40 [Intel-gfx] [PATCH] drm/i915/selftests: fix a couple IS_ERR() vs NULL tests Dan Carpenter
2022-07-08  9:02 ` Matthew Auld
2022-07-08  9:28   ` Dan Carpenter
2022-07-08  9:22 ` [Intel-gfx] ✓ Fi.CI.BAT: success for " Patchwork
2022-07-08 20:01 ` [Intel-gfx] ✗ Fi.CI.IGT: failure " Patchwork

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox