lkml.org 
[lkml]   [2024]   [Feb]   [5]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v2 06/23] gpio: add SRCU infrastructure to struct gpio_desc
On Mon, Feb 05, 2024 at 06:04:23AM -0800, Bartosz Golaszewski wrote:
> On Mon, 5 Feb 2024 14:57:45 +0100, Andy Shevchenko
> <andriy.shevchenko@linux.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@linux.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:

I am sorry, but I don't see how...

> 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);

So, you call the same several times, why?

> goto err_remove_of_chip;
> }

> >> > > + goto err_remove_of_chip;
> >> > > + }

--
With Best Regards,
Andy Shevchenko



\
 
 \ /
  Last update: 2024-05-27 14:49    [W:0.055 / U:1.768 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site