diff mbox series

[net-next,v3,5/6] doc/netlink: Allow empty enum-name in ynl specs

Message ID 20240306231046.97158-6-donald.hunter@gmail.com (mailing list archive)
State Accepted
Commit bc52b39309c3c1ab226a4f5927a7380860c0336e
Delegated to: Netdev Maintainers
Headers show
Series tools/net/ynl: Add support for nlctrl netlink family | expand

Checks

Context Check Description
netdev/series_format success Posting correctly formatted
netdev/tree_selection success Clearly marked for net-next
netdev/ynl success Generated files up to date; no warnings/errors; no diff in generated;
netdev/fixes_present success Fixes tag not required for -next series
netdev/header_inline success No static functions without inline keyword in header files
netdev/build_32bit success Errors and warnings before: 8 this patch: 8
netdev/build_tools success No tools touched, skip
netdev/cc_maintainers success CCed 4 of 4 maintainers
netdev/build_clang success Errors and warnings before: 8 this patch: 8
netdev/verify_signedoff success Signed-off-by tag matches author and committer
netdev/deprecated_api success None detected
netdev/check_selftest success No net selftest shell script
netdev/verify_fixes success No Fixes tag
netdev/build_allmodconfig_warn success Errors and warnings before: 8 this patch: 8
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 93 lines checked
netdev/build_clang_rust success No Rust files in patch. Skipping build
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/source_inline success Was 0 now: 0
netdev/contest success net-next-2024-03-07--15-00 (tests: 892)

Commit Message

Donald Hunter March 6, 2024, 11:10 p.m. UTC
Update the ynl schemas to allow the specification of empty enum names
for all enum code generation.

Signed-off-by: Donald Hunter <donald.hunter@gmail.com>
---
 Documentation/netlink/genetlink-c.yaml      | 15 +++++++++------
 Documentation/netlink/genetlink-legacy.yaml | 15 +++++++++------
 Documentation/netlink/netlink-raw.yaml      | 15 +++++++++------
 3 files changed, 27 insertions(+), 18 deletions(-)

Comments

Jakub Kicinski March 7, 2024, 2:26 a.m. UTC | #1
On Wed,  6 Mar 2024 23:10:45 +0000 Donald Hunter wrote:
> Update the ynl schemas to allow the specification of empty enum names
> for all enum code generation.

Does ethtool.yaml work for you without this change? 
It has an empty enum.

IDK how the check the exact schema version, I have:

$ rpm -qa | grep jsonschema
python3-jsonschema-specifications-2023.7.1-1.fc39.noarch
python3-jsonschema-4.19.1-1.fc39.noarch

The patch seems legit, but would be good to note for posterity 
what made this fail out of the sudden.
Donald Hunter March 7, 2024, 9:08 a.m. UTC | #2
Jakub Kicinski <kuba@kernel.org> writes:

> On Wed,  6 Mar 2024 23:10:45 +0000 Donald Hunter wrote:
>> Update the ynl schemas to allow the specification of empty enum names
>> for all enum code generation.
>
> Does ethtool.yaml work for you without this change? 
> It has an empty enum.
>
> IDK how the check the exact schema version, I have:
>
> $ rpm -qa | grep jsonschema
> python3-jsonschema-specifications-2023.7.1-1.fc39.noarch
> python3-jsonschema-4.19.1-1.fc39.noarch
>
> The patch seems legit, but would be good to note for posterity 
> what made this fail out of the sudden.

As I mentioned in the earlier thread, the schema already allowed empty
enum-name in definitions. The patch adds it to enum-name in
attribute-sets and operations.
Jakub Kicinski March 7, 2024, 3:21 p.m. UTC | #3
On Thu, 07 Mar 2024 09:08:30 +0000 Donald Hunter wrote:
> > On Wed,  6 Mar 2024 23:10:45 +0000 Donald Hunter wrote:  
> >> Update the ynl schemas to allow the specification of empty enum names
> >> for all enum code generation.  
> >
> > Does ethtool.yaml work for you without this change? 
> > It has an empty enum.
> >
> > IDK how the check the exact schema version, I have:
> >
> > $ rpm -qa | grep jsonschema
> > python3-jsonschema-specifications-2023.7.1-1.fc39.noarch
> > python3-jsonschema-4.19.1-1.fc39.noarch
> >
> > The patch seems legit, but would be good to note for posterity 
> > what made this fail out of the sudden.  
> 
> As I mentioned in the earlier thread, the schema already allowed empty
> enum-name in definitions. The patch adds it to enum-name in
> attribute-sets and operations.

Not sure how I missed that, thanks!
diff mbox series

Patch

diff --git a/Documentation/netlink/genetlink-c.yaml b/Documentation/netlink/genetlink-c.yaml
index c58f7153fcf8..3ebd50d78820 100644
--- a/Documentation/netlink/genetlink-c.yaml
+++ b/Documentation/netlink/genetlink-c.yaml
@@ -126,8 +126,9 @@  properties:
             Prefix for the C enum name of the attributes. Default family[name]-set[name]-a-
           type: string
         enum-name:
-          description: Name for the enum type of the attribute.
-          type: string
+          description: |
+            Name for the enum type of the attribute, if empty no name will be used.
+          type: [ string, "null" ]
         doc:
           description: Documentation of the space.
           type: string
@@ -261,14 +262,16 @@  properties:
           the prefix with the upper case name of the command, with dashes replaced by underscores.
         type: string
       enum-name:
-        description: Name for the enum type with commands.
-        type: string
+        description: |
+          Name for the enum type with commands, if empty no name will be used.
+        type: [ string, "null" ]
       async-prefix:
         description: Same as name-prefix but used to render notifications and events to separate enum.
         type: string
       async-enum:
-        description: Name for the enum type with notifications/events.
-        type: string
+        description: |
+          Name for the enum type with commands, if empty no name will be used.
+        type: [ string, "null" ]
       list:
         description: List of commands
         type: array
diff --git a/Documentation/netlink/genetlink-legacy.yaml b/Documentation/netlink/genetlink-legacy.yaml
index 938703088306..1d3fe3637707 100644
--- a/Documentation/netlink/genetlink-legacy.yaml
+++ b/Documentation/netlink/genetlink-legacy.yaml
@@ -168,8 +168,9 @@  properties:
             Prefix for the C enum name of the attributes. Default family[name]-set[name]-a-
           type: string
         enum-name:
-          description: Name for the enum type of the attribute.
-          type: string
+          description: |
+            Name for the enum type of the attribute, if empty no name will be used.
+          type: [ string, "null" ]
         doc:
           description: Documentation of the space.
           type: string
@@ -304,14 +305,16 @@  properties:
           the prefix with the upper case name of the command, with dashes replaced by underscores.
         type: string
       enum-name:
-        description: Name for the enum type with commands.
-        type: string
+        description: |
+          Name for the enum type with commands, if empty no name will be used.
+        type: [ string, "null" ]
       async-prefix:
         description: Same as name-prefix but used to render notifications and events to separate enum.
         type: string
       async-enum:
-        description: Name for the enum type with notifications/events.
-        type: string
+        description: |
+          Name for the enum type with commands, if empty no name will be used.
+        type: [ string, "null" ]
       # Start genetlink-legacy
       fixed-header: &fixed-header
         description: |
diff --git a/Documentation/netlink/netlink-raw.yaml b/Documentation/netlink/netlink-raw.yaml
index ac4e05415f2f..40fc8ab1ee44 100644
--- a/Documentation/netlink/netlink-raw.yaml
+++ b/Documentation/netlink/netlink-raw.yaml
@@ -189,8 +189,9 @@  properties:
             Prefix for the C enum name of the attributes. Default family[name]-set[name]-a-
           type: string
         enum-name:
-          description: Name for the enum type of the attribute.
-          type: string
+          description: |
+            Name for the enum type of the attribute, if empty no name will be used.
+          type: [ string, "null" ]
         doc:
           description: Documentation of the space.
           type: string
@@ -371,14 +372,16 @@  properties:
           the prefix with the upper case name of the command, with dashes replaced by underscores.
         type: string
       enum-name:
-        description: Name for the enum type with commands.
-        type: string
+        description: |
+          Name for the enum type with commands, if empty no name will be used.
+        type: [ string, "null" ]
       async-prefix:
         description: Same as name-prefix but used to render notifications and events to separate enum.
         type: string
       async-enum:
-        description: Name for the enum type with notifications/events.
-        type: string
+        description: |
+          Name for the enum type with commands, if empty no name will be used.
+        type: [ string, "null" ]
       # Start genetlink-legacy
       fixed-header: &fixed-header
         description: |