Re: Property names regex

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> > A property name is allowed a # anywhere in it, not just at the start.
> 
> Yes, the schemas are a bit more restrictive for modern DTs than the spec.
> 
> > How do i get this regex changed?
> 
> I committed a fix to relax this[1].

Thanks. I now have a fix for this in my tree. I've just not posted it
yet. I needed another change to make it really work. Here is my patch:

Author: Andrew Lunn <andrew@xxxxxxx>
Date:   Fri Aug 5 18:20:40 2022 -0500

    {meta-}scheme: keywords: Allow # in properties
    
    Version 0.3 of the DT specification makes no restriction of where a #
    can appear in a property name. The Marvell interrupt controller has
    the property:
    
      'marvell,#interrupts':
        description:
          number of interrupts provided by bridge interrupt controller
        $ref: /schemas/types.yaml#/definitions/uint32
        default: 32
    
    which the scheme reports as invalid. Add the # to the regex to allow
    it.
    
    Signed-off-by: Andrew Lunn <andrew@xxxxxxx>

diff --git a/dtschema/meta-schemas/keywords.yaml b/dtschema/meta-schemas/keywords.yaml
index e6ed596..3477119 100644
--- a/dtschema/meta-schemas/keywords.yaml
+++ b/dtschema/meta-schemas/keywords.yaml
@@ -169,7 +169,7 @@ properties:
       description: A json-schema keyword was found instead of a DT property name.
     propertyNames:
       description: Expected a valid DT property name
-      pattern:  "^[#$a-zA-Z][a-zA-Z0-9,+\\-._@]{0,63}$"
+      pattern:  "^[#$a-zA-Z][#a-zA-Z0-9,+\\-._@]{0,63}$"
     additionalProperties:
       $ref: "#/definitions/sub-schemas"
   required:
diff --git a/dtschema/schemas/dt-core.yaml b/dtschema/schemas/dt-core.yaml
index 1622ca0..121f476 100644
--- a/dtschema/schemas/dt-core.yaml
+++ b/dtschema/schemas/dt-core.yaml
@@ -72,7 +72,7 @@ patternProperties:
       $ref: "types.yaml#/definitions/phandle"
 
   # property and node namespace overlaps. Catch both here
-  "^[a-zA-Z0-9][a-zA-Z0-9,+\\-._]{0,63}$":
+  "^[a-zA-Z0-9][#a-zA-Z0-9,+\\-._]{0,63}$":
     type: [object, array, boolean, 'null']
 
   # Anything with a '@' is definitely a node



[Index of Archives]     [Device Tree Compilter]     [Device Tree Spec]     [Linux Driver Backports]     [Video for Linux]     [Linux USB Devel]     [Linux PCI Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Yosemite Backpacking]


  Powered by Linux