From: Lucas De Marchi <lucas.demarchi@intel.com>
To: intel-xe@lists.freedesktop.org
Cc: Lucas De Marchi <lucas.demarchi@intel.com>,
Rodrigo Vivi <rodrigo.vivi@intel.com>
Subject: [PATCH 1/3] drm/xe: Return error if drm_buddy_init() fails
Date: Thu, 14 Dec 2023 13:39:52 -0800 [thread overview]
Message-ID: <20231214213954.3223263-1-lucas.demarchi@intel.com> (raw)
Fix warning:
../drivers/gpu/drm/xe/xe_ttm_vram_mgr.c: In function ‘__xe_ttm_vram_mgr_init’:
../drivers/gpu/drm/xe/xe_ttm_vram_mgr.c:340:13: error: variable ‘err’ set but not used [-Werror=unused-but-set-variable]
340 | int err;
| ^~~
Check for the error return and return it, like done by other drivers.
Signed-off-by: Lucas De Marchi <lucas.demarchi@intel.com>
---
drivers/gpu/drm/xe/xe_ttm_vram_mgr.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/gpu/drm/xe/xe_ttm_vram_mgr.c b/drivers/gpu/drm/xe/xe_ttm_vram_mgr.c
index 953e5dc0fd80..115ec745e502 100644
--- a/drivers/gpu/drm/xe/xe_ttm_vram_mgr.c
+++ b/drivers/gpu/drm/xe/xe_ttm_vram_mgr.c
@@ -348,6 +348,8 @@ int __xe_ttm_vram_mgr_init(struct xe_device *xe, struct xe_ttm_vram_mgr *mgr,
ttm_resource_manager_init(man, &xe->ttm, size);
err = drm_buddy_init(&mgr->mm, man->size, default_page_size);
+ if (err)
+ return err;
ttm_set_driver_manager(&xe->ttm, mem_type, &mgr->manager);
ttm_resource_manager_set_used(&mgr->manager, true);
--
2.40.1
next reply other threads:[~2023-12-14 21:41 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-12-14 21:39 Lucas De Marchi [this message]
2023-12-14 21:39 ` [PATCH 2/3] drm/xe/bo: Remove unusued variable Lucas De Marchi
2023-12-14 21:46 ` Lucas De Marchi
2023-12-15 23:17 ` Matthew Brost
2023-12-14 21:39 ` [PATCH 3/3] drm/xe: Enable W=1 warnings by default Lucas De Marchi
2023-12-15 0:48 ` Rodrigo Vivi
2023-12-15 14:32 ` Rodrigo Vivi
2023-12-15 16:43 ` Lucas De Marchi
2023-12-15 8:56 ` Jani Nikula
2023-12-14 23:00 ` ✓ CI.Patch_applied: success for series starting with [1/3] drm/xe: Return error if drm_buddy_init() fails Patchwork
2023-12-14 23:00 ` ✗ CI.checkpatch: warning " Patchwork
2023-12-14 23:01 ` ✓ CI.KUnit: success " Patchwork
2023-12-14 23:08 ` ✓ CI.Build: " Patchwork
2023-12-14 23:09 ` ✓ CI.Hooks: " Patchwork
2023-12-14 23:10 ` ✓ CI.checksparse: " Patchwork
2023-12-14 23:45 ` ✓ CI.BAT: " Patchwork
2023-12-15 0:11 ` [PATCH 1/3] " Matt Roper
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20231214213954.3223263-1-lucas.demarchi@intel.com \
--to=lucas.demarchi@intel.com \
--cc=intel-xe@lists.freedesktop.org \
--cc=rodrigo.vivi@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox