[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Zhe7wK-OhvHtGTHH@smile.fi.intel.com>
Date: Thu, 11 Apr 2024 13:30:24 +0300
From: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
To: Geert Uytterhoeven <geert@...ux-m68k.org>
Cc: linux-kernel@...r.kernel.org
Subject: Re: [PATCH v1 2/2] auxdisplay: charlcd: Provide a forward declaration
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@...ux.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 */
--
With Best Regards,
Andy Shevchenko
Powered by blists - more mailing lists