[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-Id: <20220413051734.5975-1-xiam0nd.tong@gmail.com>
Date: Wed, 13 Apr 2022 13:17:34 +0800
From: Xiaomeng Tong <xiam0nd.tong@...il.com>
To: patrik.r.jakobsson@...il.com
Cc: airlied@...ux.ie, daniel@...ll.ch, dri-devel@...ts.freedesktop.org,
linux-kernel@...r.kernel.org, xiam0nd.tong@...il.com
Subject: Re: [PATCH v2] drm/gma500: fix a potential repeat execution in psb_driver_load
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
Powered by blists - more mailing lists