From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
To: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: linux-kernel@vger.kernel.org
Subject: Re: [PATCH v1 2/2] auxdisplay: charlcd: Provide a forward declaration
Date: Thu, 11 Apr 2024 13:30:24 +0300 [thread overview]
Message-ID: <Zhe7wK-OhvHtGTHH@smile.fi.intel.com> (raw)
In-Reply-To: <CAMuHMdX_n4kifH6F20tt-umtL3rY9zb6=XmgrnXvuOJSibhrEQ@mail.gmail.com>
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 */
--
With Best Regards,
Andy Shevchenko
next prev parent reply other threads:[~2024-04-11 10:30 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-04-09 16:14 [PATCH v1 0/2] auxdisplay: charlcd: Add missing macro and forward declaration Andy Shevchenko
2024-04-09 16:14 ` [PATCH v1 1/2] auxdisplay: charlcd: Add missing MODULE_DESCRIPTION() Andy Shevchenko
2024-04-11 7:31 ` Geert Uytterhoeven
2024-04-11 10:32 ` Andy Shevchenko
2024-04-09 16:14 ` [PATCH v1 2/2] auxdisplay: charlcd: Provide a forward declaration Andy Shevchenko
2024-04-11 7:30 ` Geert Uytterhoeven
2024-04-11 10:30 ` Andy Shevchenko [this message]
2024-04-23 16:35 ` Andy Shevchenko
2024-05-07 16:36 ` Andy Shevchenko
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=Zhe7wK-OhvHtGTHH@smile.fi.intel.com \
--to=andriy.shevchenko@linux.intel.com \
--cc=geert@linux-m68k.org \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox