dt-bindings: mtd: partitions: Fix partition node name pattern

Message ID 20230120020454.3225796-1-robh@kernel.org
State New
Headers
Series dt-bindings: mtd: partitions: Fix partition node name pattern |

Commit Message

Rob Herring Jan. 20, 2023, 2:04 a.m. UTC
  The 'partition' node name pattern is missing start and end anchors, so
anything is allowed before or after the regex pattern. There's no in tree
users needing that, so add anchors to the pattern.

Signed-off-by: Rob Herring <robh@kernel.org>
---
 .../devicetree/bindings/mtd/partitions/partitions.yaml          | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
  

Comments

Pratyush Yadav Jan. 20, 2023, 5:38 p.m. UTC | #1
On Thu, Jan 19 2023, Rob Herring wrote:

> The 'partition' node name pattern is missing start and end anchors, so
> anything is allowed before or after the regex pattern. There's no in tree
> users needing that, so add anchors to the pattern.
>
> Signed-off-by: Rob Herring <robh@kernel.org>

Reviewed-by: Pratyush Yadav <ptyadav@amazon.de>
  
Dhruva Gole Jan. 21, 2023, 5:09 a.m. UTC | #2
On 20/01/23 07:34, Rob Herring wrote:
> The 'partition' node name pattern is missing start and end anchors, so
> anything is allowed before or after the regex pattern. There's no in tree
> users needing that, so add anchors to the pattern.
>
> Signed-off-by: Rob Herring <robh@kernel.org>
> ---

Reviewed-by: Dhruva Gole <d-gole@ti.com>



>   .../devicetree/bindings/mtd/partitions/partitions.yaml          | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/Documentation/devicetree/bindings/mtd/partitions/partitions.yaml b/Documentation/devicetree/bindings/mtd/partitions/partitions.yaml
> index 9aca4e6c6047..2edc65e0e361 100644
> --- a/Documentation/devicetree/bindings/mtd/partitions/partitions.yaml
> +++ b/Documentation/devicetree/bindings/mtd/partitions/partitions.yaml
> @@ -32,7 +32,7 @@ properties:
>       enum: [1, 2]
>   
>   patternProperties:
> -  "partition(-.+|@[0-9a-f]+)":
> +  "^partition(-.+|@[0-9a-f]+)$":
>       $ref: partition.yaml
>   
>   required:
  
Miquel Raynal Jan. 30, 2023, 4:07 p.m. UTC | #3
Hi Rob,

robh@kernel.org wrote on Thu, 19 Jan 2023 20:04:53 -0600:

> The 'partition' node name pattern is missing start and end anchors, so
> anything is allowed before or after the regex pattern. There's no in tree
> users needing that, so add anchors to the pattern.
> 
> Signed-off-by: Rob Herring <robh@kernel.org>
> ---

Looks like my scripts did not properly sent the "applied" e-mail, so
here it is, I applied this patch to mtd/next.

Thanks,
Miquèl
  

Patch

diff --git a/Documentation/devicetree/bindings/mtd/partitions/partitions.yaml b/Documentation/devicetree/bindings/mtd/partitions/partitions.yaml
index 9aca4e6c6047..2edc65e0e361 100644
--- a/Documentation/devicetree/bindings/mtd/partitions/partitions.yaml
+++ b/Documentation/devicetree/bindings/mtd/partitions/partitions.yaml
@@ -32,7 +32,7 @@  properties:
     enum: [1, 2]
 
 patternProperties:
-  "partition(-.+|@[0-9a-f]+)":
+  "^partition(-.+|@[0-9a-f]+)$":
     $ref: partition.yaml
 
 required: