Re: [PATCH v2] drm/gma500: fix a potential repeat execution in psb_driver_load
From: Xiaomeng Tong
Date: Wed Apr 13 2022 - 01:17:44 EST
On Tue, 12 Apr 2022 16:58:24 +0200, Patrik Jakobsson wrote:
> Hi,
> This would work but using gotos like this easily turns the code into
> spaghetti. See "7. Centralized exiting of functions" in
> Documentation/process/coding-style.rst for when to use gotos.
>
> In this particular case I think we are better off using an
> if-statement. What about something like this:
>
> if (gma_encoder->type == INTEL_OUTPUT_LVDS ||
> gma_encoder->type == INTEL_OUTPUT_MIPI) {
> ret = gma_backlight_init();
> break;
> }
Yes, it looks better.
I have sent a PATCH v3 with changes as you suggested, please check it.
Thank you very much.
--
Xiaomeng Tong