Skip to contentSkip to conversation

auxdisplay: charlcd: Add missing macro and forward declaration

PATCH In review Andy Shevchenko 2 participants 9 messages Apr 9, 2024 – May 7, 2024 Auxiliary display drivers

lore
Share & tools
lore
#0 lore raw

cover auxdisplay: charlcd: Add missing macro and forward declaration

Add missing macro and forward declaration.

Andy Shevchenko (2):
auxdisplay: charlcd: Add missing MODULE_DESCRIPTION()
auxdisplay: charlcd: Provide a forward declaration

 drivers/auxdisplay/charlcd.c | 1 +
 drivers/auxdisplay/charlcd.h | 2 ++
 2 files changed, 3 insertions(+)
Signature · 1 line
2.43.0.rc1.1.gbec44491f096
#1 lore raw

PATCH 1/2 auxdisplay: charlcd: Add missing MODULE_DESCRIPTION()

The modpost script is not happy

WARNING: modpost: missing MODULE_DESCRIPTION() in drivers/auxdisplay/charlcd.o

because there is a missing module description.

Add it to the module.

---
 drivers/auxdisplay/charlcd.c | 1 +
 1 file changed, 1 insertion(+)
drivers/auxdisplay/charlcd.c +1 -0
index 6d309e4971b6..5df019720c56 100644
@@ -678,4 +678,5 @@ int charlcd_unregister(struct charlcd *lcd)
 }
 EXPORT_SYMBOL_GPL(charlcd_unregister);
 
+MODULE_DESCRIPTION("Character LCD core support");
 MODULE_LICENSE("GPL");
Signature · 1 line
2.43.0.rc1.1.gbec44491f096
#4 lore raw

PATCH 2/2 auxdisplay: charlcd: Provide a forward declaration

In reply to Andy Shevchenko

While there is no compilation error, strictly speaking compiler should know about used types beforehand. Provide a forward decration for struct charlcd_ops before using it in struct charlcd.

---
 drivers/auxdisplay/charlcd.h | 2 ++
 1 file changed, 2 insertions(+)
drivers/auxdisplay/charlcd.h +2 -0
index eed80063a6d2..4d4287209d04 100644
@@ -36,6 +36,8 @@ enum charlcd_lines {
 	CHARLCD_LINES_2,
 };
 
+struct charlcd_ops;
+
 struct charlcd {
 	const struct charlcd_ops *ops;
 	const unsigned char *char_conv;	/* Optional */
Signature · 1 line
2.43.0.rc1.1.gbec44491f096
#5 lore raw

Re: [PATCH v1 2/2] auxdisplay: charlcd: Provide a forward declaration

Hi Andy,

Quoted 2 lines · Andy Shevchenko

While there is no compilation error, strictly speaking compiler should know about used types beforehand. Provide a forward decoration

declaration

Quoted 7 lines

for struct charlcd_ops before using it in struct charlcd.

drivers/auxdisplay/charlcd.h enum charlcd_lines { · line 42

Quoted 7 lines
drivers/auxdisplay/charlcd.h +2 -0
@@ -36,6 +36,8 @@ enum charlcd_lines {
        CHARLCD_LINES_2,
 };
 
+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.

drivers/auxdisplay/charlcd.h enum charlcd_lines { · line 43

Quoted 1 line
drivers/auxdisplay/charlcd.h +0 -0
        const unsigned char *char_conv; /* Optional */

Gr{oetje,eeting}s,

Geert

Signature · 5 lines
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds
reviewer Reviewed-by on v1 1/2
#2 lore raw

Re: [PATCH v1 1/2] auxdisplay: charlcd: Add missing MODULE_DESCRIPTION()

In reply to Andy Shevchenko
Quoted 9 lines · Andy Shevchenko

The modpost script is not happy

WARNING: modpost: missing MODULE_DESCRIPTION() in drivers/auxdisplay/charlcd.o

because there is a missing module description.

Add it to the module.

Gr{oetje,eeting}s,

Geert

Signature · 5 lines
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds
#6 lore raw

Re: [PATCH v1 2/2] auxdisplay: charlcd: Provide a forward declaration

In reply to Geert Uytterhoeven
Quoted 6 lines · Geert Uytterhoeven
Quoted 2 lines · Andy Shevchenko

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.

Quoted 1 line
Quoted 1 line

for struct charlcd_ops before using it in struct charlcd.

...

Quoted 7 lines

drivers/auxdisplay/charlcd.h enum charlcd_lines { · line 42

Quoted 4 lines
drivers/auxdisplay/charlcd.h +2 -0
+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_.

Quoted 1 line
Quoted 1 line

const unsigned char *char_conv; /* Optional */

Signature · 2 lines
With Best Regards,
Andy Shevchenko
#3 lore raw

Re: [PATCH v1 1/2] auxdisplay: charlcd: Add missing MODULE_DESCRIPTION()

In reply to Geert Uytterhoeven
Quoted 6 lines · Geert Uytterhoeven
Quoted 4 lines · Andy Shevchenko

The modpost script is not happy

WARNING: modpost: missing MODULE_DESCRIPTION() in drivers/auxdisplay/charlcd.o

Quoted 7 lines
Quoted 5 lines

because there is a missing module description.

Add it to the module.

Pushed to my review and testing queue, thanks!

Signature · 2 lines
With Best Regards,
Andy Shevchenko
#7 lore raw

Re: [PATCH v1 2/2] auxdisplay: charlcd: Provide a forward declaration

In reply to Andy Shevchenko
Quoted 11 lines · Andy Shevchenko
Quoted 6 lines · Geert Uytterhoeven
Quoted 2 lines · Andy Shevchenko

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.

Quoted 1 line
Quoted 1 line

for struct charlcd_ops before using it in struct charlcd.

...

Quoted 8 lines
Quoted 7 lines

drivers/auxdisplay/charlcd.h enum charlcd_lines { · line 42

Quoted 4 lines
drivers/auxdisplay/charlcd.h +2 -0
+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.

Quoted 6 lines

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_.

Quoted 1 line
Quoted 1 line

const unsigned char *char_conv; /* Optional */

Hmm, so what's the conclusion?

Signature · 2 lines
With Best Regards,
Andy Shevchenko
#8 lore raw

Re: [PATCH v1 2/2] auxdisplay: charlcd: Provide a forward declaration

Quoted 12 lines · Andy Shevchenko
Quoted 11 lines · Andy Shevchenko
Quoted 6 lines · Geert Uytterhoeven
Quoted 2 lines · Andy Shevchenko

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.

Quoted 1 line
Quoted 1 line

for struct charlcd_ops before using it in struct charlcd.

...

Quoted 8 lines
Quoted 8 lines
Quoted 7 lines

drivers/auxdisplay/charlcd.h enum charlcd_lines { · line 42

Quoted 4 lines
drivers/auxdisplay/charlcd.h +2 -0
+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.

Quoted 8 lines
Quoted 6 lines

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_.

Quoted 1 line
Quoted 1 line

const unsigned char *char_conv; /* Optional */

Hmm, so what's the conclusion?

I'm going to apply this. Share you objections if any,

Signature · 2 lines
With Best Regards,
Andy Shevchenko