Re: [PATCH 1/4] gpiolib: cdev: relocate debounce_period_us from struct gpio_desc

From: Bartosz Golaszewski
Date: Thu Dec 14 2023 - 04:40:42 EST


On Thu, Dec 14, 2023 at 3:15 AM Kent Gibson <warthog618@xxxxxxxxx> wrote:
>
> On Thu, Dec 14, 2023 at 08:18:01AM +0800, Kent Gibson wrote:
> > On Wed, Dec 13, 2023 at 10:07:12PM +0200, Andy Shevchenko wrote:
> > > On Wed, Dec 13, 2023 at 08:03:44PM +0100, Bartosz Golaszewski wrote:
> > >
> > > ...
> > >
> > > > > - it adds complications for no benefit
> >
> > It provides a placeholder for collective documentation and clarifies
> > scope for the reader.
>
> Turns out kernel-doc can't deal with a struct variable declaration - it
> needs the struct to be named.
>
> So this doesn't parse:
>
> static struct {
> struct rb_root tree;
> spinlock_t lock;
> } supinfo;
>
> but this does:
>
> static struct supinfo {
> struct rb_root tree;
> spinlock_t lock;
> } supinfo;
>
> at which point I prefer the separate struct and var declarations as per
> the patch.
>
> Opinions?
>

Yeah, don't make it a kernel doc. It's a private structure, no need to
expose documentation for it in docs. Just use a regular comment - say
what it is and why it's here.

Bart

> Cheers,
> Kent.
>