[PATCH 05/36] drm/i915: remove conditional return with no effect
From: Sang-Heon Jeon
Date: Thu Jul 23 2026 - 14:53:39 EST
Both branches of the check return the same value, so the check has
no effect. Remove it and return the value directly.
This is the result of running the Coccinelle script from
scripts/coccinelle/misc/cond_return_no_effect.cocci.
Signed-off-by: Sang-Heon Jeon <ekffu200098@xxxxxxxxx>
---
drivers/gpu/drm/i915/display/intel_hdmi.c | 7 +------
drivers/gpu/drm/i915/gvt/gtt.c | 8 ++------
2 files changed, 3 insertions(+), 12 deletions(-)
diff --git a/drivers/gpu/drm/i915/display/intel_hdmi.c b/drivers/gpu/drm/i915/display/intel_hdmi.c
index 8a019d3574df..90880be63a1e 100644
--- a/drivers/gpu/drm/i915/display/intel_hdmi.c
+++ b/drivers/gpu/drm/i915/display/intel_hdmi.c
@@ -2658,13 +2658,8 @@ static int
intel_hdmi_connector_register(struct drm_connector *_connector)
{
struct intel_connector *connector = to_intel_connector(_connector);
- int ret;
- ret = intel_connector_register(&connector->base);
- if (ret)
- return ret;
-
- return ret;
+ return intel_connector_register(&connector->base);
}
static void intel_hdmi_connector_unregister(struct drm_connector *_connector)
diff --git a/drivers/gpu/drm/i915/gvt/gtt.c b/drivers/gpu/drm/i915/gvt/gtt.c
index 5056a5887b31..6bca40128d99 100644
--- a/drivers/gpu/drm/i915/gvt/gtt.c
+++ b/drivers/gpu/drm/i915/gvt/gtt.c
@@ -725,15 +725,11 @@ static int ppgtt_write_protection_handler(
{
struct intel_vgpu_ppgtt_spt *spt = page_track->priv_data;
- int ret;
-
if (bytes != 4 && bytes != 8)
return -EINVAL;
- ret = ppgtt_handle_guest_write_page_table_bytes(spt, gpa, data, bytes);
- if (ret)
- return ret;
- return ret;
+ return ppgtt_handle_guest_write_page_table_bytes(spt, gpa, data,
+ bytes);
}
/* Find a spt by guest gfn. */
--
2.43.0