diff mbox series

[v2,1/7] drm/i915/dsi: Replace while(1) with one with clear exit condition

Message ID 20231024155739.3861342-2-andriy.shevchenko@linux.intel.com (mailing list archive)
State New, archived
Headers show
Series drm/i915/dsi: 2nd attempt to get rid of IOSF GPIO | expand

Commit Message

Andy Shevchenko Oct. 24, 2023, 3:57 p.m. UTC
Move existing condition to while(), so it will be clear on what
circumstances the loop is successfully finishing.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
 drivers/gpu/drm/i915/display/intel_dsi_vbt.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

Comments

Andi Shyti Oct. 25, 2023, 9:15 a.m. UTC | #1
Hi Andy,

On Tue, Oct 24, 2023 at 06:57:33PM +0300, Andy Shevchenko wrote:
> Move existing condition to while(), so it will be clear on what
> circumstances the loop is successfully finishing.
> 
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>

Reviewed-by: Andi Shyti <andi.shyti@linux.intel.com>

Andi
diff mbox series

Patch

diff --git a/drivers/gpu/drm/i915/display/intel_dsi_vbt.c b/drivers/gpu/drm/i915/display/intel_dsi_vbt.c
index 24b2cbcfc1ef..a6a6f1814967 100644
--- a/drivers/gpu/drm/i915/display/intel_dsi_vbt.c
+++ b/drivers/gpu/drm/i915/display/intel_dsi_vbt.c
@@ -707,13 +707,10 @@  static void intel_dsi_vbt_exec(struct intel_dsi *intel_dsi,
 	if (connector->panel.vbt.dsi.seq_version >= 3)
 		data += 4;
 
-	while (1) {
+	while (*data != MIPI_SEQ_ELEM_END) {
 		u8 operation_byte = *data++;
 		u8 operation_size = 0;
 
-		if (operation_byte == MIPI_SEQ_ELEM_END)
-			break;
-
 		if (operation_byte < ARRAY_SIZE(exec_elem))
 			mipi_elem_exec = exec_elem[operation_byte];
 		else