Skip to content

Commit

Permalink
dt-bindings: Add missing start and/or end of line regex anchors
Browse files Browse the repository at this point in the history
json-schema patterns by default will match anywhere in a string, so
typically we want at least the start or end anchored. Fix the obvious
cases where the anchors were forgotten.

Acked-by: Matti Vaittinen <[email protected]>
Acked-by: Viresh Kumar <[email protected]>
Acked-by: Yoshihiro Shimoda <[email protected]>
Reviewed-by: Geert Uytterhoeven <[email protected]>
Acked-by: Mark Brown <[email protected]>
Acked-by: Sergio Paracuellos <[email protected]>
Acked-by: Guenter Roeck <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Rob Herring <[email protected]>
  • Loading branch information
robherring committed Dec 6, 2022
1 parent f980520 commit 7621aab
Show file tree
Hide file tree
Showing 11 changed files with 13 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ properties:
type: object

patternProperties:
'cpu@[0-9a-f]+':
'^cpu@[0-9a-f]+$':
type: object

properties:
Expand Down
4 changes: 2 additions & 2 deletions Documentation/devicetree/bindings/hwmon/adt7475.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ patternProperties:
$ref: /schemas/types.yaml#/definitions/uint32
enum: [0, 1]

"adi,pin(5|10)-function":
"^adi,pin(5|10)-function$":
description: |
Configures the function for pin 5 on the adi,adt7473 and adi,adt7475. Or
pin 10 on the adi,adt7476 and adi,adt7490.
Expand All @@ -70,7 +70,7 @@ patternProperties:
- pwm2
- smbalert#

"adi,pin(9|14)-function":
"^adi,pin(9|14)-function$":
description: |
Configures the function for pin 9 on the adi,adt7473 and adi,adt7475. Or
pin 14 on the adi,adt7476 and adi,adt7490
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,15 +41,15 @@ required:
- nvmem-cells

patternProperties:
"opp-[0-9]+":
"^opp-[0-9]+$":
type: object

properties:
opp-hz: true
clock-latency-ns: true

patternProperties:
"opp-microvolt-.*": true
"^opp-microvolt-speed[0-9]$": true

required:
- opp-hz
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ properties:
maxItems: 2

patternProperties:
'pcie@[0-2],0':
'^pcie@[0-2],0$':
type: object
$ref: /schemas/pci/pci-bus.yaml#

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ properties:
maxItems: 1

patternProperties:
'usb@[0-1],0':
'^usb@[0-1],0$':
type: object

description:
Expand Down
2 changes: 1 addition & 1 deletion Documentation/devicetree/bindings/regulator/max8660.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ properties:
type: object

patternProperties:
"regulator-.+":
"^regulator-.+$":
$ref: "regulator.yaml#"

additionalProperties: false
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ patternProperties:
regulator-initial-mode: false

patternProperties:
regulator-state-(standby|mem|disk):
"^regulator-state-(standby|mem|disk)$":
type: object
additionalProperties: true
properties:
Expand Down
2 changes: 1 addition & 1 deletion Documentation/devicetree/bindings/regulator/regulator.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ patternProperties:
".*-supply$":
description: Input supply phandle(s) for this node

regulator-state-(standby|mem|disk):
"^regulator-state-(standby|mem|disk)$":
type: object
description:
sub-nodes for regulator state in Standby, Suspend-to-RAM, and
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ description: |
regulator-voutl1, regulator-vouts1
patternProperties:
"regulator-.+":
"^regulator-.+$":
type: object
description:
Properties for single regulator.
Expand Down
2 changes: 1 addition & 1 deletion Documentation/devicetree/bindings/sound/renesas,rsnd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ properties:
ports:
$ref: /schemas/graph.yaml#/properties/ports
patternProperties:
port(@[0-9a-f]+)?:
'^port(@[0-9a-f]+)?$':
$ref: audio-graph-port.yaml#
unevaluatedProperties: false

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ properties:
- const: tx

patternProperties:
"@[0-9a-f]+":
"@[0-9a-f]+$":
type: object

properties:
Expand Down

0 comments on commit 7621aab

Please sign in to comment.