[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAMRc=Mf740MJEg5fkAZaeL5yZAvVpJvjJ3zWcn-gWqS6_ue1mA@mail.gmail.com>
Date: Mon, 5 Feb 2024 06:04:23 -0800
From: Bartosz Golaszewski <brgl@...ev.pl>
To: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
Cc: Linus Walleij <linus.walleij@...aro.org>, Kent Gibson <warthog618@...il.com>,
Alex Elder <elder@...aro.org>, Geert Uytterhoeven <geert+renesas@...der.be>,
"Paul E . McKenney" <paulmck@...nel.org>, Wolfram Sang <wsa@...-dreams.de>, linux-gpio@...r.kernel.org,
linux-kernel@...r.kernel.org,
Bartosz Golaszewski <bartosz.golaszewski@...aro.org>, Bartosz Golaszewski <brgl@...ev.pl>
Subject: Re: [PATCH v2 06/23] gpio: add SRCU infrastructure to struct gpio_desc
On Mon, 5 Feb 2024 14:57:45 +0100, Andy Shevchenko
<andriy.shevchenko@...ux.intel.com> said:
> On Mon, Feb 05, 2024 at 02:54:08PM +0100, Bartosz Golaszewski wrote:
>> On Mon, Feb 5, 2024 at 2:48 PM Andy Shevchenko
>> <andriy.shevchenko@...ux.intel.com> wrote:
>> > On Mon, Feb 05, 2024 at 10:34:01AM +0100, Bartosz Golaszewski wrote:
>
> ...
>
>> > > + for (j = 0; j < i; j++)
>> > > + cleanup_srcu_struct(&desc->srcu);
>> >
>> > What does this loop mean?
>>
>> I open-coded it because I want to store the value of i to go back and
>> destroy the SRCU structs on failure.
>
> Where/how is j being used?
>
In this bit:
for (i = 0; i < gc->ngpio; i++) {
struct gpio_desc *desc = &gdev->descs[i];
ret = init_srcu_struct(&desc->srcu);
if (ret) {
for (j = 0; j < i; j++)
cleanup_srcu_struct(&desc->srcu);
goto err_remove_of_chip;
}
Bart
>> > > + goto err_remove_of_chip;
>> > > + }
>
> --
> With Best Regards,
> Andy Shevchenko
>
>
>
Powered by blists - more mailing lists