[PATCH 06/14] drm/mgag200: Simplify function mgag200_ttm_placement()

Takashi Iwai tiwai at suse.de
Tue Jul 18 14:43:12 UTC 2017


From: Egbert Eich <eich at suse.de>

Just a code refactoring, no functional change.

Signed-off-by: Egbert Eich <eich at suse.de>
Signed-off-by: Takashi Iwai <tiwai at suse.de>
---
 drivers/gpu/drm/mgag200/mgag200_drv.h | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)

diff --git a/drivers/gpu/drm/mgag200/mgag200_drv.h b/drivers/gpu/drm/mgag200/mgag200_drv.h
index a724e1931e87..2ba4060e3363 100644
--- a/drivers/gpu/drm/mgag200/mgag200_drv.h
+++ b/drivers/gpu/drm/mgag200/mgag200_drv.h
@@ -285,12 +285,10 @@ static inline int mgag200_bo_reserve(struct mgag200_bo *bo, bool no_wait)
 	int ret;
 
 	ret = ttm_bo_reserve(&bo->bo, true, no_wait, NULL);
-	if (ret) {
-		if (ret != -ERESTARTSYS && ret != -EBUSY)
-			DRM_ERROR("reserve failed %p\n", bo);
-		return ret;
-	}
-	return 0;
+	if (ret && ret != -ERESTARTSYS && ret != -EBUSY)
+		DRM_ERROR("reserve failed %p\n", bo);
+
+	return ret;
 }
 
 static inline void mgag200_bo_unreserve(struct mgag200_bo *bo)
-- 
2.13.2



More information about the dri-devel mailing list