mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-30 14:19:16 +00:00
tools: ynl-gen: lift type requirement for attribute subsets
In case an attribute is used in a subset, the type has to be currently specified. As the attribute is already defined in the original set, this is a redundant information in yaml file, moreover, may lead to inconsistencies. Example: attribute-sets: ... name: pin enum-name: dpll_a_pin attributes: ... - name: parent-id type: u32 ... - name: pin-parent-device subset-of: pin attributes: - name: parent-id type: u32 <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< Remove the requirement from schema files to specify the "type" for attribute subsets. Signed-off-by: Jiri Pirko <jiri@nvidia.com> Reviewed-by: Jakub Kicinski <kuba@kernel.org> Link: https://lore.kernel.org/r/20231006114436.1725425-2-jiri@resnulli.us Signed-off-by: Jakub Kicinski <kuba@kernel.org>
This commit is contained in:
parent
c042353955
commit
e18f3dc2be
4 changed files with 52 additions and 4 deletions
|
@ -142,7 +142,7 @@ properties:
|
||||||
type: array
|
type: array
|
||||||
items:
|
items:
|
||||||
type: object
|
type: object
|
||||||
required: [ name, type ]
|
required: [ name ]
|
||||||
additionalProperties: False
|
additionalProperties: False
|
||||||
properties:
|
properties:
|
||||||
name:
|
name:
|
||||||
|
@ -215,6 +215,18 @@ properties:
|
||||||
not:
|
not:
|
||||||
required: [ name-prefix ]
|
required: [ name-prefix ]
|
||||||
|
|
||||||
|
# type property is only required if not in subset definition
|
||||||
|
if:
|
||||||
|
properties:
|
||||||
|
subset-of:
|
||||||
|
not:
|
||||||
|
type: string
|
||||||
|
then:
|
||||||
|
properties:
|
||||||
|
attributes:
|
||||||
|
items:
|
||||||
|
required: [ type ]
|
||||||
|
|
||||||
operations:
|
operations:
|
||||||
description: Operations supported by the protocol.
|
description: Operations supported by the protocol.
|
||||||
type: object
|
type: object
|
||||||
|
|
|
@ -180,7 +180,7 @@ properties:
|
||||||
type: array
|
type: array
|
||||||
items:
|
items:
|
||||||
type: object
|
type: object
|
||||||
required: [ name, type ]
|
required: [ name ]
|
||||||
additionalProperties: False
|
additionalProperties: False
|
||||||
properties:
|
properties:
|
||||||
name:
|
name:
|
||||||
|
@ -254,6 +254,18 @@ properties:
|
||||||
not:
|
not:
|
||||||
required: [ name-prefix ]
|
required: [ name-prefix ]
|
||||||
|
|
||||||
|
# type property is only required if not in subset definition
|
||||||
|
if:
|
||||||
|
properties:
|
||||||
|
subset-of:
|
||||||
|
not:
|
||||||
|
type: string
|
||||||
|
then:
|
||||||
|
properties:
|
||||||
|
attributes:
|
||||||
|
items:
|
||||||
|
required: [ type ]
|
||||||
|
|
||||||
operations:
|
operations:
|
||||||
description: Operations supported by the protocol.
|
description: Operations supported by the protocol.
|
||||||
type: object
|
type: object
|
||||||
|
|
|
@ -115,7 +115,7 @@ properties:
|
||||||
type: array
|
type: array
|
||||||
items:
|
items:
|
||||||
type: object
|
type: object
|
||||||
required: [ name, type ]
|
required: [ name ]
|
||||||
additionalProperties: False
|
additionalProperties: False
|
||||||
properties:
|
properties:
|
||||||
name:
|
name:
|
||||||
|
@ -184,6 +184,18 @@ properties:
|
||||||
not:
|
not:
|
||||||
required: [ name-prefix ]
|
required: [ name-prefix ]
|
||||||
|
|
||||||
|
# type property is only required if not in subset definition
|
||||||
|
if:
|
||||||
|
properties:
|
||||||
|
subset-of:
|
||||||
|
not:
|
||||||
|
type: string
|
||||||
|
then:
|
||||||
|
properties:
|
||||||
|
attributes:
|
||||||
|
items:
|
||||||
|
required: [ type ]
|
||||||
|
|
||||||
operations:
|
operations:
|
||||||
description: Operations supported by the protocol.
|
description: Operations supported by the protocol.
|
||||||
type: object
|
type: object
|
||||||
|
|
|
@ -187,7 +187,7 @@ properties:
|
||||||
type: array
|
type: array
|
||||||
items:
|
items:
|
||||||
type: object
|
type: object
|
||||||
required: [ name, type ]
|
required: [ name ]
|
||||||
additionalProperties: False
|
additionalProperties: False
|
||||||
properties:
|
properties:
|
||||||
name:
|
name:
|
||||||
|
@ -261,6 +261,18 @@ properties:
|
||||||
not:
|
not:
|
||||||
required: [ name-prefix ]
|
required: [ name-prefix ]
|
||||||
|
|
||||||
|
# type property is only required if not in subset definition
|
||||||
|
if:
|
||||||
|
properties:
|
||||||
|
subset-of:
|
||||||
|
not:
|
||||||
|
type: string
|
||||||
|
then:
|
||||||
|
properties:
|
||||||
|
attributes:
|
||||||
|
items:
|
||||||
|
required: [ type ]
|
||||||
|
|
||||||
operations:
|
operations:
|
||||||
description: Operations supported by the protocol.
|
description: Operations supported by the protocol.
|
||||||
type: object
|
type: object
|
||||||
|
|
Loading…
Reference in a new issue