public inbox for devicetree@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/1] dt-bindings: Fix multi pattern support in DT_SCHEMA_FILES
@ 2023-02-09  0:26 Cristian Ciocaltea
  2023-02-09 18:56 ` Rob Herring
  0 siblings, 1 reply; 3+ messages in thread
From: Cristian Ciocaltea @ 2023-02-09  0:26 UTC (permalink / raw)
  To: Rob Herring, Krzysztof Kozlowski; +Cc: devicetree, linux-kernel, kernel

DT_SCHEMA_FILES used to allow specifying a space separated list of file
paths, but the introduction of partial matches support broke this
feature:

$ make dtbs_check DT_SCHEMA_FILES="path/to/schema1.yaml path/to/schema2.yaml"
[...]
  LINT    Documentation/devicetree/bindings
usage: yamllint [-h] [-] [-c CONFIG_FILE | -d CONFIG_DATA] [--list-files] [...]
                [-v]
                [FILE_OR_DIR ...]
yamllint: error: one of the arguments FILE_OR_DIR - is required
[...]

Restore the lost functionality by preparing a grep filter that is able
to handle multiple search patterns.

Fixes: 309d955985ee ("dt-bindings: kbuild: Support partial matches with DT_SCHEMA_FILES")

Signed-off-by: Cristian Ciocaltea <cristian.ciocaltea@collabora.com>
---
 Documentation/devicetree/bindings/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Documentation/devicetree/bindings/Makefile b/Documentation/devicetree/bindings/Makefile
index bf2d8a8ced77..5475c25ae803 100644
--- a/Documentation/devicetree/bindings/Makefile
+++ b/Documentation/devicetree/bindings/Makefile
@@ -28,7 +28,7 @@ $(obj)/%.example.dts: $(src)/%.yaml check_dtschema_version FORCE
 find_all_cmd = find $(srctree)/$(src) \( -name '*.yaml' ! \
 		-name 'processed-schema*' \)
 
-find_cmd = $(find_all_cmd) | grep -F "$(DT_SCHEMA_FILES)"
+find_cmd = $(find_all_cmd) | grep -F -e "$(subst $() ," -e ",$(strip $(DT_SCHEMA_FILES)))"
 CHK_DT_DOCS := $(shell $(find_cmd))
 
 quiet_cmd_yamllint = LINT    $(src)
-- 
2.39.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH 1/1] dt-bindings: Fix multi pattern support in DT_SCHEMA_FILES
  2023-02-09  0:26 [PATCH 1/1] dt-bindings: Fix multi pattern support in DT_SCHEMA_FILES Cristian Ciocaltea
@ 2023-02-09 18:56 ` Rob Herring
  2023-02-09 19:14   ` Cristian Ciocaltea
  0 siblings, 1 reply; 3+ messages in thread
From: Rob Herring @ 2023-02-09 18:56 UTC (permalink / raw)
  To: Cristian Ciocaltea; +Cc: Krzysztof Kozlowski, devicetree, linux-kernel, kernel

On Thu, Feb 09, 2023 at 02:26:34AM +0200, Cristian Ciocaltea wrote:
> DT_SCHEMA_FILES used to allow specifying a space separated list of file
> paths, but the introduction of partial matches support broke this
> feature:

That only happened to work by chance...

> 
> $ make dtbs_check DT_SCHEMA_FILES="path/to/schema1.yaml path/to/schema2.yaml"

Spaces are valid in filenames though we avoid them. Perhaps it would be 
better to use ':'.

> [...]
>   LINT    Documentation/devicetree/bindings
> usage: yamllint [-h] [-] [-c CONFIG_FILE | -d CONFIG_DATA] [--list-files] [...]
>                 [-v]
>                 [FILE_OR_DIR ...]
> yamllint: error: one of the arguments FILE_OR_DIR - is required

I think this also happens if nothing matches.

> [...]
> 
> Restore the lost functionality by preparing a grep filter that is able
> to handle multiple search patterns.
> 
> Fixes: 309d955985ee ("dt-bindings: kbuild: Support partial matches with DT_SCHEMA_FILES")
> 

Should be no blank line.

> Signed-off-by: Cristian Ciocaltea <cristian.ciocaltea@collabora.com>
> ---
>  Documentation/devicetree/bindings/Makefile | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/Documentation/devicetree/bindings/Makefile b/Documentation/devicetree/bindings/Makefile
> index bf2d8a8ced77..5475c25ae803 100644
> --- a/Documentation/devicetree/bindings/Makefile
> +++ b/Documentation/devicetree/bindings/Makefile
> @@ -28,7 +28,7 @@ $(obj)/%.example.dts: $(src)/%.yaml check_dtschema_version FORCE
>  find_all_cmd = find $(srctree)/$(src) \( -name '*.yaml' ! \
>  		-name 'processed-schema*' \)
>  
> -find_cmd = $(find_all_cmd) | grep -F "$(DT_SCHEMA_FILES)"
> +find_cmd = $(find_all_cmd) | grep -F -e "$(subst $() ," -e ",$(strip $(DT_SCHEMA_FILES)))"
>  CHK_DT_DOCS := $(shell $(find_cmd))
>  
>  quiet_cmd_yamllint = LINT    $(src)
> -- 
> 2.39.1
> 

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH 1/1] dt-bindings: Fix multi pattern support in DT_SCHEMA_FILES
  2023-02-09 18:56 ` Rob Herring
@ 2023-02-09 19:14   ` Cristian Ciocaltea
  0 siblings, 0 replies; 3+ messages in thread
From: Cristian Ciocaltea @ 2023-02-09 19:14 UTC (permalink / raw)
  To: Rob Herring; +Cc: Krzysztof Kozlowski, devicetree, linux-kernel, kernel

On 2/9/23 20:56, Rob Herring wrote:
> On Thu, Feb 09, 2023 at 02:26:34AM +0200, Cristian Ciocaltea wrote:
>> DT_SCHEMA_FILES used to allow specifying a space separated list of file
>> paths, but the introduction of partial matches support broke this
>> feature:
> 
> That only happened to work by chance...
> 

Yeah, I remember you mentioned that a while ago when I provided a 
similar fix (96993a59f94d). I still find this useful, though..

>>
>> $ make dtbs_check DT_SCHEMA_FILES="path/to/schema1.yaml path/to/schema2.yaml"
> 
> Spaces are valid in filenames though we avoid them. Perhaps it would be
> better to use ':'.

Agree, will handle this in v2.

>> [...]
>>    LINT    Documentation/devicetree/bindings
>> usage: yamllint [-h] [-] [-c CONFIG_FILE | -d CONFIG_DATA] [--list-files] [...]
>>                  [-v]
>>                  [FILE_OR_DIR ...]
>> yamllint: error: one of the arguments FILE_OR_DIR - is required
> 
> I think this also happens if nothing matches.
> 
>> [...]
>>
>> Restore the lost functionality by preparing a grep filter that is able
>> to handle multiple search patterns.
>>
>> Fixes: 309d955985ee ("dt-bindings: kbuild: Support partial matches with DT_SCHEMA_FILES")
>>
> 
> Should be no blank line.

Thanks for noticing, that was unintentional.

>> Signed-off-by: Cristian Ciocaltea <cristian.ciocaltea@collabora.com>
>> ---
>>   Documentation/devicetree/bindings/Makefile | 2 +-
>>   1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/Documentation/devicetree/bindings/Makefile b/Documentation/devicetree/bindings/Makefile
>> index bf2d8a8ced77..5475c25ae803 100644
>> --- a/Documentation/devicetree/bindings/Makefile
>> +++ b/Documentation/devicetree/bindings/Makefile
>> @@ -28,7 +28,7 @@ $(obj)/%.example.dts: $(src)/%.yaml check_dtschema_version FORCE
>>   find_all_cmd = find $(srctree)/$(src) \( -name '*.yaml' ! \
>>   		-name 'processed-schema*' \)
>>   
>> -find_cmd = $(find_all_cmd) | grep -F "$(DT_SCHEMA_FILES)"
>> +find_cmd = $(find_all_cmd) | grep -F -e "$(subst $() ," -e ",$(strip $(DT_SCHEMA_FILES)))"
>>   CHK_DT_DOCS := $(shell $(find_cmd))
>>   
>>   quiet_cmd_yamllint = LINT    $(src)
>> -- 
>> 2.39.1
>>

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2023-02-09 19:14 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-02-09  0:26 [PATCH 1/1] dt-bindings: Fix multi pattern support in DT_SCHEMA_FILES Cristian Ciocaltea
2023-02-09 18:56 ` Rob Herring
2023-02-09 19:14   ` Cristian Ciocaltea

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox