mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Rolf Eike Beer <eb@emlix.com>
To: Jani Nikula <jani.nikula@linux.intel.com>,
	Joonas Lahtinen <joonas.lahtinen@linux.intel.com>,
	Rodrigo Vivi <rodrigo.vivi@intel.com>,
	Tvrtko Ursulin <tursulin@ursulin.net>
Cc: intel-gfx@lists.freedesktop.org, linux-kernel@vger.kernel.org
Subject: [PATCH 2/2] drm/i915: mark i915_gem_object_trylock() as __must_check
Date: Thu, 19 Dec 2024 11:18:08 +0100	[thread overview]
Message-ID: <6005320.MhkbZ0Pkbq@devpool47.emlix.com> (raw)
In-Reply-To: <7746997.EvYhyI6sBW@devpool47.emlix.com>

When you don't look at the return code you can't know if you actually got the
lock.

Signed-off-by: Rolf Eike Beer <eb@emlix.com>
---
 drivers/gpu/drm/i915/gem/i915_gem_object.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/i915/gem/i915_gem_object.h b/drivers/gpu/drm/i915/gem/i915_gem_object.h
index 3dc61cbd2e11..b6da8b561ae0 100644
--- a/drivers/gpu/drm/i915/gem/i915_gem_object.h
+++ b/drivers/gpu/drm/i915/gem/i915_gem_object.h
@@ -198,8 +198,8 @@ static inline int i915_gem_object_lock_interruptible(struct drm_i915_gem_object
 	return __i915_gem_object_lock(obj, ww, true);
 }
 
-static inline bool i915_gem_object_trylock(struct drm_i915_gem_object *obj,
-					   struct i915_gem_ww_ctx *ww)
+static inline bool __must_check i915_gem_object_trylock(struct drm_i915_gem_object *obj,
+							struct i915_gem_ww_ctx *ww)
 {
 	if (!ww)
 		return dma_resv_trylock(obj->base.resv);
-- 
2.47.1


-- 
Rolf Eike Beer

emlix GmbH
Headquarters: Berliner Str. 12, 37073 Göttingen, Germany
Phone +49 (0)551 30664-0, e-mail info@emlix.com
District Court of Göttingen, Registry Number HR B 3160
Managing Directors: Heike Jordan, Dr. Uwe Kracke
VAT ID No. DE 205 198 055
Office Berlin: Panoramastr. 1, 10178 Berlin, Germany
Office Bonn: Bachstr. 6, 53115 Bonn, Germany
http://www.emlix.com

emlix - your embedded Linux partner



      parent reply	other threads:[~2024-12-19 10:18 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-12-19 10:16 [PATCH 0/2] annotate " Rolf Eike Beer
2024-12-19 10:16 ` [PATCH 1/2] drm/i915/selftests: check the return value of i915_gem_object_trylock() Rolf Eike Beer
2024-12-19 10:18 ` Rolf Eike Beer [this message]

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=6005320.MhkbZ0Pkbq@devpool47.emlix.com \
    --to=eb@emlix.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=jani.nikula@linux.intel.com \
    --cc=joonas.lahtinen@linux.intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rodrigo.vivi@intel.com \
    --cc=tursulin@ursulin.net \
    /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

all inboxes | Powered by JetHome®