Skip to contentSkip to conversation

scripts: kernel-doc: Restore anonymous enum parsing

PATCH Applied Andy Shevchenko 3 participants 6 messages Nov 2, 2020 – Nov 13, 2020 Documentation

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 scripts: kernel-doc: Restore anonymous enum parsing

The commit d38c8cfb0571 ("scripts: kernel-doc: add support for typedef enum") broke anonymous enum parsing. Restore it by relying on members rather than its name.

Fixes d38c8cfb0571 ("scripts: kernel-doc: add support for typedef enum")
Cc Mauro Carvalho Chehab <[email protected]>
---
 scripts/kernel-doc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
scripts/kernel-doc +1 -1
index f699cf05d409..9b6ddeb097e9 100755
@@ -1390,7 +1390,7 @@ sub dump_enum($$) {
 	$members = $2;
     }
 
-    if ($declaration_name) {
+    if ($members) {
 	my %_members;
 
 	$members =~ s/\s+$//;
Signature · 1 line
2.28.0
#1 lore raw

Em Mon, 2 Nov 2020 19:06:37 +0200
Andy Shevchenko <[email protected]> escreveu:

Quoted 8 lines

The commit d38c8cfb0571 ("scripts: kernel-doc: add support for typedef enum") broke anonymous enum parsing. Restore it by relying on members rather than its name.

Fixes d38c8cfb0571 ("scripts: kernel-doc: add support for typedef enum")
Cc Mauro Carvalho Chehab <[email protected]>

Patch looks ok to me. Do you have an example about using it for anonymous enum?

Quoted 9 lines
---
 scripts/kernel-doc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
scripts/kernel-doc +0 -0
index f699cf05d409..9b6ddeb097e9 100755

scripts/kernel-doc sub dump_enum($$) { · line 1396

Quoted 8 lines
scripts/kernel-doc +1 -1
@@ -1390,7 +1390,7 @@ sub dump_enum($$) {
 	$members = $2;
     }
 
-    if ($declaration_name) {
+    if ($members) {
 	my %_members;
 
 	$members =~ s/\s+$//;

Thanks,
Mauro

#2 lore raw
Quoted 7 lines · Mauro Carvalho Chehab

Em Mon, 2 Nov 2020 19:06:37 +0200
Andy Shevchenko <[email protected]> escreveu:

Quoted 4 lines

The commit d38c8cfb0571 ("scripts: kernel-doc: add support for typedef enum") broke anonymous enum parsing. Restore it by relying on members rather than its name.

Quoted 7 lines
Quoted 4 lines
Fixes d38c8cfb0571 ("scripts: kernel-doc: add support for typedef enum")
Cc Mauro Carvalho Chehab <[email protected]>

Patch looks ok to me. Do you have an example about using it for anonymous enum?

drivers/pinctrl/intel/pinctrl-intel.c

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

Em Mon, 2 Nov 2020 19:48:46 +0200
Andy Shevchenko <[email protected]> escreveu:

Quoted 13 lines · Mauro Carvalho Chehab
Quoted 12 lines

Em Mon, 2 Nov 2020 19:06:37 +0200
Andy Shevchenko <[email protected]> escreveu:

Quoted 8 lines

The commit d38c8cfb0571 ("scripts: kernel-doc: add support for typedef enum") broke anonymous enum parsing. Restore it by relying on members rather than its name.

Fixes d38c8cfb0571 ("scripts: kernel-doc: add support for typedef enum")
Cc Mauro Carvalho Chehab <[email protected]>
Quoted 5 lines
Quoted 2 lines

Patch looks ok to me. Do you have an example about using it for anonymous enum?

drivers/pinctrl/intel/pinctrl-intel.c

Thanks!

Both include/linux/phy.h and drivers/pinctrl/intel/pinctrl-intel.c are parsing fine after your patch.

So,

Thanks,
Mauro

#4 lore raw
Quoted 22 lines · Mauro Carvalho Chehab

Em Mon, 2 Nov 2020 19:48:46 +0200
Andy Shevchenko <[email protected]> escreveu:

Quoted 13 lines · Mauro Carvalho Chehab
Quoted 12 lines

Em Mon, 2 Nov 2020 19:06:37 +0200
Andy Shevchenko <[email protected]> escreveu:

Quoted 8 lines

The commit d38c8cfb0571 ("scripts: kernel-doc: add support for typedef enum") broke anonymous enum parsing. Restore it by relying on members rather than its name.

Fixes d38c8cfb0571 ("scripts: kernel-doc: add support for typedef enum")
Cc Mauro Carvalho Chehab <[email protected]>
Quoted 5 lines
Quoted 2 lines

Patch looks ok to me. Do you have an example about using it for anonymous enum?

drivers/pinctrl/intel/pinctrl-intel.c

Quoted 8 lines

Thanks!

Both include/linux/phy.h and drivers/pinctrl/intel/pinctrl-intel.c are parsing fine after your patch.

So,

Thanks!

Jonathan, can we have this applied?

Signature · 2 lines
With Best Regards,
Andy Shevchenko
maintainer Applied
#5 lore raw
In reply to Andy Shevchenko
Quoted 17 lines · On Mon, 2 Nov 2020 19:06:37 +0200 Andy Shevchenko…

The commit d38c8cfb0571 ("scripts: kernel-doc: add support for typedef enum") broke anonymous enum parsing. Restore it by relying on members rather than its name.

Fixes d38c8cfb0571 ("scripts: kernel-doc: add support for typedef enum")
Cc Mauro Carvalho Chehab <[email protected]>
---
 scripts/kernel-doc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
scripts/kernel-doc +0 -0
index f699cf05d409..9b6ddeb097e9 100755

scripts/kernel-doc sub dump_enum($$) { · line 1394

Quoted 6 lines
scripts/kernel-doc +1 -1
@@ -1390,7 +1390,7 @@ sub dump_enum($$) {
 	$members = $2;
     }
 
-    if ($declaration_name) {
+    if ($members) {
 	my %_members;

Applied, thanks.

jon