mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* kernel-doc: Not stripped #define/#ifdef/#endif in enums
@ 2015-11-01 16:20 conchur
  2015-11-02 17:16 ` Jonathan Corbet
  0 siblings, 1 reply; 5+ messages in thread
From: conchur @ 2015-11-01 16:20 UTC (permalink / raw)
  To: linux-kernel
  Cc: Jonathan Corbet, Ben Hutchings, Andrew Morton, Randy Dunlap,
	Danilo Cesar Lemes de Paula, "Jérémy Bobbio",
	Johannes Berg, Bart Van Assche

Hi,
 
just noticed that #define in kernel-doc are not correctly stripped anymore from enums. Here is my patch

 
--- a/scripts/kernel-doc
+++ b/scripts/kernel-doc
@@ -1830,7 +1830,7 @@ sub dump_enum($$) {
     my $file = shift;
 
     $x =~ s@/\*.*?\*/@@gos;	# strip comments.
-    $x =~ s/^#\s*define\s+.*$//; # strip #define macros inside enums
+    $x =~ s@#\s*define\s+[^;]*;@@gos; # strip #define macros inside enums
 
     if ($x =~ /enum\s+(\w+)\s*{(.*)}/) {
 	$declaration_name = $1;

 
But there are also places in the kernel where #ifdef/#endif is used inside enums. So maybe this should also be stripped:

--- a/scripts/kernel-doc
+++ b/scripts/kernel-doc
@@ -1830,7 +1830,8 @@ sub dump_enum($$) {
     my $file = shift;
 
     $x =~ s@/\*.*?\*/@@gos;	# strip comments.
-    $x =~ s/^#\s*define\s+.*$//; # strip #define macros inside enums
+    # strip #define/#ifdef/#endif macros inside enums
+    $x =~ s@#\s*((define|ifdef)\s+|endif)[^;]*;@@gos;
 
     if ($x =~ /enum\s+(\w+)\s*{(.*)}/) {
 	$declaration_name = $1;


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: kernel-doc: Not stripped #define/#ifdef/#endif in enums
  2015-11-01 16:20 kernel-doc: Not stripped #define/#ifdef/#endif in enums conchur
@ 2015-11-02 17:16 ` Jonathan Corbet
  2015-11-20 11:27   ` Aw: " conchur
  0 siblings, 1 reply; 5+ messages in thread
From: Jonathan Corbet @ 2015-11-02 17:16 UTC (permalink / raw)
  To: conchur
  Cc: linux-kernel, Ben Hutchings, Andrew Morton, Randy Dunlap,
	Danilo Cesar Lemes de Paula, Jérémy Bobbio,
	Johannes Berg, Bart Van Assche

On Sun, 1 Nov 2015 17:20:11 +0100
conchur@web.de wrote:

> just noticed that #define in kernel-doc are not correctly stripped
> anymore from enums. Here is my patch

Thanks for your patches, but I can't apply them in their current form.
Could you please do me a favor and:

 - Include changelogs that say why the changes are being made - what is
   the problem with how things are now?

 - Include a proper signoff.  See Documentation/SubmittingPatches for
   details.

You can probably trim the CC list somewhat the next time around as well.

Thanks,

jon

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Aw: Re: kernel-doc: Not stripped #define/#ifdef/#endif in enums
  2015-11-02 17:16 ` Jonathan Corbet
@ 2015-11-20 11:27   ` conchur
  2015-11-20 14:37     ` Jonathan Corbet
  0 siblings, 1 reply; 5+ messages in thread
From: conchur @ 2015-11-20 11:27 UTC (permalink / raw)
  To: Jonathan Corbet
  Cc: linux-kernel, Ben Hutchings, Andrew Morton, Randy Dunlap,
	Danilo Cesar Lemes de Paula, "Jérémy Bobbio",
	Johannes Berg, Bart Van Assche

> > just noticed that #define in kernel-doc are not correctly stripped
> > anymore from enums. Here is my patch
> 
> Thanks for your patches, but I can't apply them in their current form.
> Could you please do me a favor and:
> 
> - Include changelogs that say why the changes are being made - what is
> the problem with how things are now?
> 
> - Include a proper signoff. See Documentation/SubmittingPatches for
> details.
> 
> You can probably trim the CC list somewhat the next time around as well.

I did all that but now my patches were just ignored.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: kernel-doc: Not stripped #define/#ifdef/#endif in enums
  2015-11-20 11:27   ` Aw: " conchur
@ 2015-11-20 14:37     ` Jonathan Corbet
  2015-11-20 19:49       ` Aw: " conchur
  0 siblings, 1 reply; 5+ messages in thread
From: Jonathan Corbet @ 2015-11-20 14:37 UTC (permalink / raw)
  To: conchur
  Cc: linux-kernel, Ben Hutchings, Andrew Morton, Randy Dunlap,
	Danilo Cesar Lemes de Paula, Jérémy Bobbio,
	Johannes Berg, Bart Van Assche

On Fri, 20 Nov 2015 12:27:54 +0100
conchur@web.de wrote:

> I did all that but now my patches were just ignored.

They arrived during the merge window and were put into my docs folder for
further consideration.  I've not yet started my 4.5 branch - been a bit
busy, sorry - but will look at them when I do.  That could happen as soon
as today.

jon

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Aw: Re: kernel-doc: Not stripped #define/#ifdef/#endif in enums
  2015-11-20 14:37     ` Jonathan Corbet
@ 2015-11-20 19:49       ` conchur
  0 siblings, 0 replies; 5+ messages in thread
From: conchur @ 2015-11-20 19:49 UTC (permalink / raw)
  To: Jonathan Corbet
  Cc: linux-kernel, Ben Hutchings, Andrew Morton, Randy Dunlap,
	Danilo Cesar Lemes de Paula, "Jérémy Bobbio",
	Johannes Berg, Bart Van Assche

> > I did all that but now my patches were just ignored.
> 
> They arrived during the merge window and were put into my docs folder for
> further consideration. I've not yet started my 4.5 branch - been a bit
> busy, sorry - but will look at them when I do. That could happen as soon
> as today.

Ah, ok - thanks

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2015-11-20 19:50 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-11-01 16:20 kernel-doc: Not stripped #define/#ifdef/#endif in enums conchur
2015-11-02 17:16 ` Jonathan Corbet
2015-11-20 11:27   ` Aw: " conchur
2015-11-20 14:37     ` Jonathan Corbet
2015-11-20 19:49       ` Aw: " conchur

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®