[PATCH 2/6] drm/cirrus-qemu: Remove redundant else in atomic_check
Aditya Garg
gargaditya08 at live.com
Tue Feb 25 11:06:39 UTC 2025
From: Aditya Garg <gargaditya08 at live.com>
Remove the redundant else statement from atomic_check since the previous if
statement was returning if true.
Signed-off-by: Aditya Garg <gargaditya08 at live.com>
---
drivers/gpu/drm/tiny/cirrus-qemu.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/drivers/gpu/drm/tiny/cirrus-qemu.c b/drivers/gpu/drm/tiny/cirrus-qemu.c
index 52ec1e4ea..e696531b6 100644
--- a/drivers/gpu/drm/tiny/cirrus-qemu.c
+++ b/drivers/gpu/drm/tiny/cirrus-qemu.c
@@ -359,7 +359,8 @@ static int cirrus_primary_plane_helper_atomic_check(struct drm_plane *plane,
false, false);
if (ret)
return ret;
- else if (!new_plane_state->visible)
+
+ if (!new_plane_state->visible)
return 0;
pitch = cirrus_pitch(fb);
@@ -367,7 +368,8 @@ static int cirrus_primary_plane_helper_atomic_check(struct drm_plane *plane,
/* validate size constraints */
if (pitch > CIRRUS_MAX_PITCH)
return -EINVAL;
- else if (pitch * fb->height > CIRRUS_VRAM_SIZE)
+
+ if (pitch * fb->height > CIRRUS_VRAM_SIZE)
return -EINVAL;
new_primary_plane_state->format = cirrus_format(fb);
--
2.43.0
More information about the dri-devel
mailing list