Re: [PATCH v2] drm/gma500: fix a potential repeat execution in psb_driver_load

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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



[Index of Archives]     [Linux DRI Users]     [Linux Intel Graphics]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux