linux-doc.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH docs] scripts: kernel-doc: support private / public marking for enums
@ 2023-06-21 22:35 Jakub Kicinski
  2023-06-22  3:10 ` Randy Dunlap
  2023-07-03 16:48 ` Jonathan Corbet
  0 siblings, 2 replies; 7+ messages in thread
From: Jakub Kicinski @ 2023-06-21 22:35 UTC (permalink / raw)
  To: corbet; +Cc: linux-doc, arkadiusz.kubalewski, netdev, Jakub Kicinski

Enums benefit from private markings, too. For netlink attribute
name enums always end with a pair of __$n_MAX and $n_MAX members.
Documenting them feels a bit tedious.

Signed-off-by: Jakub Kicinski <kuba@kernel.org>
---
Hi Jon, we've CCed you recently on a related discussion
but it appears that the fix is simple enough so posting
it before you had a chance to reply.
---
 scripts/kernel-doc | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/scripts/kernel-doc b/scripts/kernel-doc
index 2486689ffc7b..66b554897899 100755
--- a/scripts/kernel-doc
+++ b/scripts/kernel-doc
@@ -1301,6 +1301,9 @@ sub dump_enum($$) {
     my $file = shift;
     my $members;
 
+    # ignore members marked private:
+    $x =~ s/\/\*\s*private:.*?\/\*\s*public:.*?\*\///gosi;
+    $x =~ s/\/\*\s*private:.*}/}/gosi;
 
     $x =~ s@/\*.*?\*/@@gos;	# strip comments.
     # strip #define macros inside enums
-- 
2.40.1


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

* Re: [PATCH docs] scripts: kernel-doc: support private / public marking for enums
  2023-06-21 22:35 [PATCH docs] scripts: kernel-doc: support private / public marking for enums Jakub Kicinski
@ 2023-06-22  3:10 ` Randy Dunlap
  2023-07-14  5:03   ` Randy Dunlap
  2023-07-03 16:48 ` Jonathan Corbet
  1 sibling, 1 reply; 7+ messages in thread
From: Randy Dunlap @ 2023-06-22  3:10 UTC (permalink / raw)
  To: Jakub Kicinski, corbet; +Cc: linux-doc, arkadiusz.kubalewski, netdev



On 6/21/23 15:35, Jakub Kicinski wrote:
> Enums benefit from private markings, too. For netlink attribute
> name enums always end with a pair of __$n_MAX and $n_MAX members.
> Documenting them feels a bit tedious.
> 
> Signed-off-by: Jakub Kicinski <kuba@kernel.org>

Reviewed-by: Randy Dunlap <rdunlap@infradead.org>
Tested-by: Randy Dunlap <rdunlap@infradead.org>

Thanks.

> ---
> Hi Jon, we've CCed you recently on a related discussion
> but it appears that the fix is simple enough so posting
> it before you had a chance to reply.
> ---
>  scripts/kernel-doc | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/scripts/kernel-doc b/scripts/kernel-doc
> index 2486689ffc7b..66b554897899 100755
> --- a/scripts/kernel-doc
> +++ b/scripts/kernel-doc
> @@ -1301,6 +1301,9 @@ sub dump_enum($$) {
>      my $file = shift;
>      my $members;
>  
> +    # ignore members marked private:
> +    $x =~ s/\/\*\s*private:.*?\/\*\s*public:.*?\*\///gosi;
> +    $x =~ s/\/\*\s*private:.*}/}/gosi;
>  
>      $x =~ s@/\*.*?\*/@@gos;	# strip comments.
>      # strip #define macros inside enums

-- 
~Randy

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

* Re: [PATCH docs] scripts: kernel-doc: support private / public marking for enums
  2023-06-21 22:35 [PATCH docs] scripts: kernel-doc: support private / public marking for enums Jakub Kicinski
  2023-06-22  3:10 ` Randy Dunlap
@ 2023-07-03 16:48 ` Jonathan Corbet
  1 sibling, 0 replies; 7+ messages in thread
From: Jonathan Corbet @ 2023-07-03 16:48 UTC (permalink / raw)
  To: Jakub Kicinski; +Cc: linux-doc, arkadiusz.kubalewski, netdev, Jakub Kicinski

Jakub Kicinski <kuba@kernel.org> writes:

> Enums benefit from private markings, too. For netlink attribute
> name enums always end with a pair of __$n_MAX and $n_MAX members.
> Documenting them feels a bit tedious.
>
> Signed-off-by: Jakub Kicinski <kuba@kernel.org>
> ---
> Hi Jon, we've CCed you recently on a related discussion
> but it appears that the fix is simple enough so posting
> it before you had a chance to reply.
> ---
>  scripts/kernel-doc | 3 +++
>  1 file changed, 3 insertions(+)

Hmm...somehow I missed the discussion, sorry.  Fix applied, thanks.

jon

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

* Re: [PATCH docs] scripts: kernel-doc: support private / public marking for enums
  2023-06-22  3:10 ` Randy Dunlap
@ 2023-07-14  5:03   ` Randy Dunlap
  2023-07-14 13:29     ` Jonathan Corbet
  0 siblings, 1 reply; 7+ messages in thread
From: Randy Dunlap @ 2023-07-14  5:03 UTC (permalink / raw)
  To: Jakub Kicinski, corbet; +Cc: linux-doc, arkadiusz.kubalewski, netdev

Hi Jon,

On 6/21/23 20:10, Randy Dunlap wrote:
> 
> 
> On 6/21/23 15:35, Jakub Kicinski wrote:
>> Enums benefit from private markings, too. For netlink attribute
>> name enums always end with a pair of __$n_MAX and $n_MAX members.
>> Documenting them feels a bit tedious.
>>
>> Signed-off-by: Jakub Kicinski <kuba@kernel.org>
> 
> Reviewed-by: Randy Dunlap <rdunlap@infradead.org>
> Tested-by: Randy Dunlap <rdunlap@infradead.org>
> 
> Thanks.

I have a need for this patch. Are you planning to merge it?

in current linux-next docs build:

../include/drm/drm_connector.h:527: warning: Enum value 'DRM_MODE_COLORIMETRY_COUNT' not described in enum 'drm_colorspace'

That enum identifier could/should be marked as private:.

Thanks.

> 
>> ---
>> Hi Jon, we've CCed you recently on a related discussion
>> but it appears that the fix is simple enough so posting
>> it before you had a chance to reply.
>> ---
>>  scripts/kernel-doc | 3 +++
>>  1 file changed, 3 insertions(+)
>>
>> diff --git a/scripts/kernel-doc b/scripts/kernel-doc
>> index 2486689ffc7b..66b554897899 100755
>> --- a/scripts/kernel-doc
>> +++ b/scripts/kernel-doc
>> @@ -1301,6 +1301,9 @@ sub dump_enum($$) {
>>      my $file = shift;
>>      my $members;
>>  
>> +    # ignore members marked private:
>> +    $x =~ s/\/\*\s*private:.*?\/\*\s*public:.*?\*\///gosi;
>> +    $x =~ s/\/\*\s*private:.*}/}/gosi;
>>  
>>      $x =~ s@/\*.*?\*/@@gos;	# strip comments.
>>      # strip #define macros inside enums
> 

-- 
~Randy

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

* Re: [PATCH docs] scripts: kernel-doc: support private / public marking for enums
  2023-07-14  5:03   ` Randy Dunlap
@ 2023-07-14 13:29     ` Jonathan Corbet
  2023-07-14 15:15       ` Randy Dunlap
  0 siblings, 1 reply; 7+ messages in thread
From: Jonathan Corbet @ 2023-07-14 13:29 UTC (permalink / raw)
  To: Randy Dunlap, Jakub Kicinski; +Cc: linux-doc, arkadiusz.kubalewski, netdev

Randy Dunlap <rdunlap@infradead.org> writes:

> Hi Jon,
>
> On 6/21/23 20:10, Randy Dunlap wrote:
>> 
>> 
>> On 6/21/23 15:35, Jakub Kicinski wrote:
>>> Enums benefit from private markings, too. For netlink attribute
>>> name enums always end with a pair of __$n_MAX and $n_MAX members.
>>> Documenting them feels a bit tedious.
>>>
>>> Signed-off-by: Jakub Kicinski <kuba@kernel.org>
>> 
>> Reviewed-by: Randy Dunlap <rdunlap@infradead.org>
>> Tested-by: Randy Dunlap <rdunlap@infradead.org>
>> 
>> Thanks.
>
> I have a need for this patch. Are you planning to merge it?

It's commit e27cb89a22ad in 6.5-rc1 ...

Thanks,

jon

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

* Re: [PATCH docs] scripts: kernel-doc: support private / public marking for enums
  2023-07-14 13:29     ` Jonathan Corbet
@ 2023-07-14 15:15       ` Randy Dunlap
  2023-07-16  0:35         ` Randy Dunlap
  0 siblings, 1 reply; 7+ messages in thread
From: Randy Dunlap @ 2023-07-14 15:15 UTC (permalink / raw)
  To: Jonathan Corbet, Jakub Kicinski; +Cc: linux-doc, arkadiusz.kubalewski, netdev



On 7/14/23 06:29, Jonathan Corbet wrote:
> Randy Dunlap <rdunlap@infradead.org> writes:
> 
>> Hi Jon,
>>
>> On 6/21/23 20:10, Randy Dunlap wrote:
>>>
>>>
>>> On 6/21/23 15:35, Jakub Kicinski wrote:
>>>> Enums benefit from private markings, too. For netlink attribute
>>>> name enums always end with a pair of __$n_MAX and $n_MAX members.
>>>> Documenting them feels a bit tedious.
>>>>
>>>> Signed-off-by: Jakub Kicinski <kuba@kernel.org>
>>>
>>> Reviewed-by: Randy Dunlap <rdunlap@infradead.org>
>>> Tested-by: Randy Dunlap <rdunlap@infradead.org>
>>>
>>> Thanks.
>>
>> I have a need for this patch. Are you planning to merge it?
> 
> It's commit e27cb89a22ad in 6.5-rc1 ...

Oops, my bad, sorry about that.

I'm testing with linux-next. Something is rotten here /methinks.

I will check it out.

-- 
~Randy

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

* Re: [PATCH docs] scripts: kernel-doc: support private / public marking for enums
  2023-07-14 15:15       ` Randy Dunlap
@ 2023-07-16  0:35         ` Randy Dunlap
  0 siblings, 0 replies; 7+ messages in thread
From: Randy Dunlap @ 2023-07-16  0:35 UTC (permalink / raw)
  To: Jonathan Corbet, Jakub Kicinski; +Cc: linux-doc, arkadiusz.kubalewski, netdev



On 7/14/23 08:15, Randy Dunlap wrote:
> 
> 
> On 7/14/23 06:29, Jonathan Corbet wrote:
>> Randy Dunlap <rdunlap@infradead.org> writes:
>>
>>> Hi Jon,
>>>
>>> On 6/21/23 20:10, Randy Dunlap wrote:
>>>>
>>>>
>>>> On 6/21/23 15:35, Jakub Kicinski wrote:
>>>>> Enums benefit from private markings, too. For netlink attribute
>>>>> name enums always end with a pair of __$n_MAX and $n_MAX members.
>>>>> Documenting them feels a bit tedious.
>>>>>
>>>>> Signed-off-by: Jakub Kicinski <kuba@kernel.org>
>>>>
>>>> Reviewed-by: Randy Dunlap <rdunlap@infradead.org>
>>>> Tested-by: Randy Dunlap <rdunlap@infradead.org>
>>>>
>>>> Thanks.
>>>
>>> I have a need for this patch. Are you planning to merge it?
>>
>> It's commit e27cb89a22ad in 6.5-rc1 ...
> 
> Oops, my bad, sorry about that.
> 
> I'm testing with linux-next. Something is rotten here /methinks.
> 
> I will check it out.

Apparently this was due to user error -- it works today.
Sorry about the noise.


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

end of thread, other threads:[~2023-07-16  0:35 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-06-21 22:35 [PATCH docs] scripts: kernel-doc: support private / public marking for enums Jakub Kicinski
2023-06-22  3:10 ` Randy Dunlap
2023-07-14  5:03   ` Randy Dunlap
2023-07-14 13:29     ` Jonathan Corbet
2023-07-14 15:15       ` Randy Dunlap
2023-07-16  0:35         ` Randy Dunlap
2023-07-03 16:48 ` Jonathan Corbet

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).