drm/i915/dsi: Replace while(1) with one with clear exit condition
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Fri, 3 Nov 2023 20:18:21 +0000 (22:18 +0200)
committerJani Nikula <jani.nikula@intel.com>
Wed, 22 Nov 2023 16:50:27 +0000 (18:50 +0200)
Move existing condition to while(), so it will be clear on what
circumstances the loop is successfully finishing.

Reviewed-by: Andi Shyti <andi.shyti@linux.intel.com>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Acked-by: Jani Nikula <jani.nikula@intel.com>
Tested-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20231103201831.1037416-7-andriy.shevchenko@linux.intel.com
drivers/gpu/drm/i915/display/intel_dsi_vbt.c

index 4af43cf3cee00c17eadca49074757166ead32161..290a112f1b630033b2a1d471bb2935166a85502c 100644 (file)
@@ -702,13 +702,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