Skip to contentSkip to conversation

Doc: netlink: support unterminated-ok

PATCH Superseded Hangbin Liu 2 participants 2 messages Mar 7, 2024 – Mar 8, 2024

Subsystems (3)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Doc: netlink: support unterminated-ok

ynl-gen-c.py supports check unterminated-ok, but the yaml schemas don't have this key. Add this to the yaml files.

---
 Documentation/netlink/genetlink-c.yaml      | 3 +++
 Documentation/netlink/genetlink-legacy.yaml | 3 +++
 Documentation/netlink/genetlink.yaml        | 3 +++
 Documentation/netlink/netlink-raw.yaml      | 3 +++
 4 files changed, 12 insertions(+)
Documentation/netlink/genetlink-c.yaml +3 -0
index c58f7153fcf8..7094d619cbb6 100644
@@ -208,6 +208,9 @@ properties:
                   exact-len:
                     description: Exact length for a string or a binary attribute.
                     $ref: '#/$defs/len-or-define'
+                  unterminated-ok:
+                    description: Allow the string to not use terminator.
+                    type: boolean
               sub-type: *attr-type
               display-hint: &display-hint
                 description: |
Documentation/netlink/genetlink-legacy.yaml +3 -0
index 938703088306..aceb72175365 100644
@@ -251,6 +251,9 @@ properties:
                   exact-len:
                     description: Exact length for a string or a binary attribute.
                     $ref: '#/$defs/len-or-define'
+                  unterminated-ok:
+                    description: Allow the string to not use terminator.
+                    type: boolean
               sub-type: *attr-type
               display-hint: *display-hint
               # Start genetlink-c
Documentation/netlink/genetlink.yaml +3 -0
index 3283bf458ff1..f6d5ea44bf86 100644
@@ -175,6 +175,9 @@ properties:
                   exact-len:
                     description: Exact length for a string or a binary attribute.
                     $ref: '#/$defs/len-or-define'
+                  unterminated-ok:
+                    description: Allow the string to not use terminator.
+                    type: boolean
               sub-type: *attr-type
               display-hint: &display-hint
                 description: |
Documentation/netlink/netlink-raw.yaml +3 -0
index ac4e05415f2f..0e105f21080b 100644
@@ -270,6 +270,9 @@ properties:
                   exact-len:
                     description: Exact length for a string or a binary attribute.
                     $ref: '#/$defs/len-or-define'
+                  unterminated-ok:
+                    description: Allow the string to not use terminator.
+                    type: boolean
               sub-type: *attr-type
               display-hint: *display-hint
               # Start genetlink-c
Signature · 1 line
2.43.0
maintainer
#1 lore raw
Quoted 1 line · On Thu, 7 Mar 2024 15:01:06 +0800 Hangbin Liu wrote:

Subject: [PATCH net-next] Doc: netlink: support unterminated-ok

I'd use this subject:

netlink: specs: support unterminated-ok

Quoted 8 lines

ynl-gen-c.py supports check unterminated-ok, but the yaml schemas don't have this key. Add this to the yaml files.

Documentation/netlink/genetlink-c.yaml +0 -0
index c58f7153fcf8..7094d619cbb6 100644

Documentation/netlink/genetlink-c.yaml properties: · line 213

Quoted 6 lines
Documentation/netlink/genetlink-c.yaml +3 -0
@@ -208,6 +208,9 @@ properties:
                   exact-len:
                     description: Exact length for a string or a binary attribute.
                     $ref: '#/$defs/len-or-define'
+                  unterminated-ok:
+                    description: Allow the string to not use terminator.
+                    type: boolean

Can we expand the doc a little? How about:

description: |
For string attributes, do not check whether attribute contains the terminating null character.

Also maybe let's leave this out of the spec for:

Documentation/netlink/genetlink.yaml

that spec is supposed to be simplified, supporting both string flavors just complicates things.