Skip to contentSkip to conversation

drm/i915: simplify the return expression of i915_driver_open()

PATCH In review [email protected] 2 participants 2 messages May 5, 2022

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm/i915: simplify the return expression of i915_driver_open()

From: Minghao Chi <[email protected]>

Simplify the return expression.

---
 drivers/gpu/drm/i915/i915_driver.c | 7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)
drivers/gpu/drm/i915/i915_driver.c +1 -6
index 09de45d3e274..d11a7445909a 100644
@@ -977,13 +977,8 @@ static void i915_driver_release(struct drm_device *dev)
 static int i915_driver_open(struct drm_device *dev, struct drm_file *file)
 {
 	struct drm_i915_private *i915 = to_i915(dev);
-	int ret;
 
-	ret = i915_gem_open(i915, file);
-	if (ret)
-		return ret;
-
-	return 0;
+	return i915_gem_open(i915, file);
 }
 
 /**
Signature · 1 line
2.25.1
maintainer
#1 lore raw
Quoted 6 lines · On Thu, 05 May 2022, [email protected] wrote:

From: Minghao Chi <[email protected]>

Simplify the return expression.

No, I don't want this. Please stop sending these return expression "simplifications". The cocci script to do this was removed in commit b784c7707502 ("coccinnelle: Remove ptr_ret script") specifically to stop these changes. Please read the commit message for that.

BR,
Jani.

Quoted 23 lines
---
 drivers/gpu/drm/i915/i915_driver.c | 7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)
drivers/gpu/drm/i915/i915_driver.c +1 -6
index 09de45d3e274..d11a7445909a 100644
@@ -977,13 +977,8 @@ static void i915_driver_release(struct drm_device *dev)
 static int i915_driver_open(struct drm_device *dev, struct drm_file *file)
 {
 	struct drm_i915_private *i915 = to_i915(dev);
-	int ret;
 
-	ret = i915_gem_open(i915, file);
-	if (ret)
-		return ret;
-
-	return 0;
+	return i915_gem_open(i915, file);
 }
 
 /**
Signature · 1 line
Jani Nikula, Intel Open Source Graphics Center