[prev in list] [next in list] [prev in thread] [next in thread] 

List:       linux-kernel
Subject:    Re: [PATCH v1 2/2] auxdisplay: charlcd: Provide a forward declaration
From:       Andy Shevchenko <andriy.shevchenko () linux ! intel ! com>
Date:       2024-04-23 16:35:02
Message-ID: ZifjNpEetImWWcOb () smile ! fi ! intel ! com
[Download RAW message or body]

On Thu, Apr 11, 2024 at 01:30:25PM +0300, Andy Shevchenko wrote:
> On Thu, Apr 11, 2024 at 09:30:31AM +0200, Geert Uytterhoeven wrote:
> > On Tue, Apr 9, 2024 at 6:15 PM Andy Shevchenko
> > <andriy.shevchenko@linux.intel.com> wrote:
> > > While there is no compilation error, strictly speaking compiler
> > > should know about used types beforehand. Provide a forward decoration
> > 
> > declaration
> 
> Thanks, I updated locally. Please, see my answer below.
> 
> > > for struct charlcd_ops before using it in struct charlcd.

..

> > > +struct charlcd_ops;
> > > +
> > >  struct charlcd {
> > >         const struct charlcd_ops *ops;
> > 
> > No forward declaration is needed at this point, as ops is a _pointer_ to
> > the structure.
> 
> The same way as in all other cases. We may drop all of them, but strictly
> speaking (as I mentioned in the commit message) this is a good practice.
> 
> I.o.w. a forward declaration of custom data types is used for _pointers_.
> 
> > >         const unsigned char *char_conv; /* Optional */

Hmm, so what's the conclusion?

-- 
With Best Regards,
Andy Shevchenko



[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic