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

2022-04-12 Thread Xiaomeng Tong
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

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

2022-04-12 Thread Patrik Jakobsson
On Wed, Apr 6, 2022 at 1:31 PM Xiaomeng Tong wrote: > > Instead of exiting the loop as expected when an entry is found, the > list_for_each_entry() continues until the traversal is complete. To > avoid potential executing 'ret = gma_backlight_init(dev);' repeatly, > goto outside the loop when the

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

2022-04-06 Thread Xiaomeng Tong
Instead of exiting the loop as expected when an entry is found, the list_for_each_entry() continues until the traversal is complete. To avoid potential executing 'ret = gma_backlight_init(dev);' repeatly, goto outside the loop when the entry is found. Signed-off-by: Xiaomeng Tong --- changes sin