drm/atomic: Return commit in drm_crtc_commit_get for better annotation
authorMaarten Lankhorst <maarten.lankhorst@linux.intel.com>
Mon, 4 Sep 2017 10:48:36 +0000 (12:48 +0200)
committerMaarten Lankhorst <maarten.lankhorst@linux.intel.com>
Fri, 8 Sep 2017 08:39:37 +0000 (10:39 +0200)
This will allow code to do x->commit = drm_crtc_commit_get(commit),
making it clearer where references are used.

Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20170904104838.23822-5-maarten.lankhorst@linux.intel.com
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
drivers/gpu/drm/drm_atomic_helper.c
include/drm/drm_atomic.h

index 1bc32cd74d78e61126d0b67a4a1c3e477b2582d9..94ad11f76e0e05b8d3a02f8fea152e78ff1a2d8e 100644 (file)
@@ -1633,8 +1633,7 @@ static int stall_checks(struct drm_crtc *crtc, bool nonblock)
                                return -EBUSY;
                        }
                } else if (i == 1) {
-                       stall_commit = commit;
-                       drm_crtc_commit_get(stall_commit);
+                       stall_commit = drm_crtc_commit_get(commit);
                        break;
                }
 
index f73b663c1f76a8de0ebaf418ae3f63a1bf42d3f4..c0451e2a51af902ae4b1aa050b96585bd5fa7847 100644 (file)
@@ -252,10 +252,14 @@ void __drm_crtc_commit_free(struct kref *kref);
  * @commit: CRTC commit
  *
  * Increases the reference of @commit.
+ *
+ * Returns:
+ * The pointer to @commit, with reference increased.
  */
-static inline void drm_crtc_commit_get(struct drm_crtc_commit *commit)
+static inline struct drm_crtc_commit *drm_crtc_commit_get(struct drm_crtc_commit *commit)
 {
        kref_get(&commit->ref);
+       return commit;
 }
 
 /**