Skip to content

Commit 9948eb0

Browse files
committed
scripts/dts/extract: Don't warn for 'category' merge of 'required'
We get warnings like: foo.yaml('BAH') merge of property 'category': 'required' overwrites 'optional' This warning isn't meaningful as its reasonable to change the 'category' of a property from 'optional' to 'required'. So don't warn in the case anymore. Signed-off-by: Kumar Gala <[email protected]>
1 parent a6d82db commit 9948eb0

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

scripts/dts/extract_dts_includes.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -515,8 +515,15 @@ def dict_merge(parent, fname, dct, merge_dct):
515515
dict_merge(k, fname, dct[k], merge_dct[k])
516516
else:
517517
if k in dct and dct[k] != merge_dct[k]:
518-
print("extract_dts_includes.py: {}('{}') merge of property '{}': '{}' overwrites '{}'.".format(
519-
fname, parent, k, merge_dct[k], dct[k]))
518+
merge_warn = True
519+
# Don't warn if we are changing the "category" from "optional
520+
# to "required"
521+
if (k == "category" and dct[k] == "optional" and
522+
merge_dct[k] == "required"):
523+
merge_warn = False
524+
if merge_warn:
525+
print("extract_dts_includes.py: {}('{}') merge of property '{}': '{}' overwrites '{}'.".format(
526+
fname, parent, k, merge_dct[k], dct[k]))
520527
dct[k] = merge_dct[k]
521528

522529

0 commit comments

Comments
 (0)