* [PATCH] scripts: dtc: fix a false alarm for node_name_chars_strict
@ 2022-05-31 5:33 Qun-Wei Lin
2022-05-31 13:06 ` Rob Herring
2022-05-31 20:43 ` Frank Rowand
0 siblings, 2 replies; 6+ messages in thread
From: Qun-Wei Lin @ 2022-05-31 5:33 UTC (permalink / raw)
To: robh+dt, frowand.list, matthias.bgg
Cc: devicetree, linux-kernel, linux-arm-kernel, linux-mediatek,
casper.li, chinwen.chang, kuan-ying.lee, Qun-Wei Lin
The function check_node_name_chars_strict issues a false alarm when
compiling an overlay dts.
/fragment@0/__overlay__: Character '_' not recommended in node name
This workaround will fix it by skip checking for node named __overlay__.
Signed-off-by: Qun-Wei Lin <qun-wei.lin@mediatek.com>
---
scripts/dtc/checks.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/scripts/dtc/checks.c b/scripts/dtc/checks.c
index 781ba1129a8e..6ef4f2cd67b9 100644
--- a/scripts/dtc/checks.c
+++ b/scripts/dtc/checks.c
@@ -325,6 +325,11 @@ static void check_node_name_chars_strict(struct check *c, struct dt_info *dti,
{
int n = strspn(node->name, c->data);
+ if (streq(node->name, "__overlay__")) {
+ /* HACK: Overlay fragments are a special case */
+ return;
+ }
+
if (n < node->basenamelen)
FAIL(c, dti, node, "Character '%c' not recommended in node name",
node->name[n]);
--
2.18.0
^ permalink raw reply related [flat|nested] 6+ messages in thread* Re: [PATCH] scripts: dtc: fix a false alarm for node_name_chars_strict
2022-05-31 5:33 [PATCH] scripts: dtc: fix a false alarm for node_name_chars_strict Qun-Wei Lin
@ 2022-05-31 13:06 ` Rob Herring
2022-05-31 20:43 ` Frank Rowand
1 sibling, 0 replies; 6+ messages in thread
From: Rob Herring @ 2022-05-31 13:06 UTC (permalink / raw)
To: Qun-Wei Lin
Cc: Frank Rowand, Matthias Brugger, devicetree,
linux-kernel@vger.kernel.org, linux-arm-kernel,
moderated list:ARM/Mediatek SoC support, casper.li, chinwen.chang,
kuan-ying.lee
On Tue, May 31, 2022 at 12:34 AM Qun-Wei Lin <qun-wei.lin@mediatek.com> wrote:
>
> The function check_node_name_chars_strict issues a false alarm when
> compiling an overlay dts.
>
> /fragment@0/__overlay__: Character '_' not recommended in node name
>
> This workaround will fix it by skip checking for node named __overlay__.
>
> Signed-off-by: Qun-Wei Lin <qun-wei.lin@mediatek.com>
> ---
> scripts/dtc/checks.c | 5 +++++
We don't take patches for dtc. You must send them to upstream dtc and
then it will be sync'ed to the kernel tree.
> 1 file changed, 5 insertions(+)
>
> diff --git a/scripts/dtc/checks.c b/scripts/dtc/checks.c
> index 781ba1129a8e..6ef4f2cd67b9 100644
> --- a/scripts/dtc/checks.c
> +++ b/scripts/dtc/checks.c
> @@ -325,6 +325,11 @@ static void check_node_name_chars_strict(struct check *c, struct dt_info *dti,
> {
> int n = strspn(node->name, c->data);
>
> + if (streq(node->name, "__overlay__")) {
> + /* HACK: Overlay fragments are a special case */
Not a hack IMO.
However, this should be checking for any node name starting with '__'.
Also, doesn't 'fragment@0' cause a warning about missing 'reg'?
^ permalink raw reply [flat|nested] 6+ messages in thread* Re: [PATCH] scripts: dtc: fix a false alarm for node_name_chars_strict
2022-05-31 5:33 [PATCH] scripts: dtc: fix a false alarm for node_name_chars_strict Qun-Wei Lin
2022-05-31 13:06 ` Rob Herring
@ 2022-05-31 20:43 ` Frank Rowand
2022-05-31 21:49 ` Rob Herring
1 sibling, 1 reply; 6+ messages in thread
From: Frank Rowand @ 2022-05-31 20:43 UTC (permalink / raw)
To: Qun-Wei Lin, robh+dt, matthias.bgg
Cc: devicetree, linux-kernel, linux-arm-kernel, linux-mediatek,
casper.li, chinwen.chang, kuan-ying.lee
On 5/31/22 01:33, Qun-Wei Lin wrote:
> The function check_node_name_chars_strict issues a false alarm when
> compiling an overlay dts.
>
> /fragment@0/__overlay__: Character '_' not recommended in node name
>
> This workaround will fix it by skip checking for node named __overlay__.
This is not a false alarm.
Do not special case node name "__overlay__". This node name should never
occur in a modern overlay source file.
For details, see "Overlay Source Format" in the "Overlays" section of:
https://elinux.org/Device_Tree_Reference#Overlays
That paragraph also has a pointer to the correct format for overlay
source files, which is slides 29-34 of:
https://elinux.org/Device_Tree_Reference#Overlays
-Frank
>
> Signed-off-by: Qun-Wei Lin <qun-wei.lin@mediatek.com>
> ---
> scripts/dtc/checks.c | 5 +++++
> 1 file changed, 5 insertions(+)
>
> diff --git a/scripts/dtc/checks.c b/scripts/dtc/checks.c
> index 781ba1129a8e..6ef4f2cd67b9 100644
> --- a/scripts/dtc/checks.c
> +++ b/scripts/dtc/checks.c
> @@ -325,6 +325,11 @@ static void check_node_name_chars_strict(struct check *c, struct dt_info *dti,
> {
> int n = strspn(node->name, c->data);
>
> + if (streq(node->name, "__overlay__")) {
> + /* HACK: Overlay fragments are a special case */
> + return;
> + }
> +
> if (n < node->basenamelen)
> FAIL(c, dti, node, "Character '%c' not recommended in node name",
> node->name[n]);
^ permalink raw reply [flat|nested] 6+ messages in thread* Re: [PATCH] scripts: dtc: fix a false alarm for node_name_chars_strict
2022-05-31 20:43 ` Frank Rowand
@ 2022-05-31 21:49 ` Rob Herring
2022-06-01 1:45 ` Frank Rowand
0 siblings, 1 reply; 6+ messages in thread
From: Rob Herring @ 2022-05-31 21:49 UTC (permalink / raw)
To: Frank Rowand
Cc: Qun-Wei Lin, matthias.bgg, devicetree, linux-kernel,
linux-arm-kernel, linux-mediatek, casper.li, chinwen.chang,
kuan-ying.lee
On Tue, May 31, 2022 at 04:43:18PM -0400, Frank Rowand wrote:
> On 5/31/22 01:33, Qun-Wei Lin wrote:
> > The function check_node_name_chars_strict issues a false alarm when
> > compiling an overlay dts.
> >
> > /fragment@0/__overlay__: Character '_' not recommended in node name
> >
> > This workaround will fix it by skip checking for node named __overlay__.
>
> This is not a false alarm.
>
> Do not special case node name "__overlay__". This node name should never
> occur in a modern overlay source file.
A dtbo -> dts pass will give warnings, so handling these nodes is
worthwhile. Though thinking a bit more about it, I think this one is off
by default, but W=2 turns it on.
Rob
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] scripts: dtc: fix a false alarm for node_name_chars_strict
2022-05-31 21:49 ` Rob Herring
@ 2022-06-01 1:45 ` Frank Rowand
[not found] ` <b054866a5c043d3b6d5553057b5f5bf7b06681f0.camel@mediatek.com>
0 siblings, 1 reply; 6+ messages in thread
From: Frank Rowand @ 2022-06-01 1:45 UTC (permalink / raw)
To: Rob Herring
Cc: Qun-Wei Lin, matthias.bgg, devicetree, linux-kernel,
linux-arm-kernel, linux-mediatek, casper.li, chinwen.chang,
kuan-ying.lee
On 5/31/22 17:49, Rob Herring wrote:
> On Tue, May 31, 2022 at 04:43:18PM -0400, Frank Rowand wrote:
>> On 5/31/22 01:33, Qun-Wei Lin wrote:
>>> The function check_node_name_chars_strict issues a false alarm when
>>> compiling an overlay dts.
>>>
>>> /fragment@0/__overlay__: Character '_' not recommended in node name
>>>
>>> This workaround will fix it by skip checking for node named __overlay__.
>>
>> This is not a false alarm.
>>
>> Do not special case node name "__overlay__". This node name should never
>> occur in a modern overlay source file.
>
> A dtbo -> dts pass will give warnings, so handling these nodes is
> worthwhile. Though thinking a bit more about it, I think this one is off
> by default, but W=2 turns it on.
Yes, at least as of 5.18-rc1 the warning is only if
'-W node_name_chars_strict', so a dtbo -> dts pass will not give the
warning for node __overlay__ by default.
-Frank
>
> Rob
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2022-06-02 3:07 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-05-31 5:33 [PATCH] scripts: dtc: fix a false alarm for node_name_chars_strict Qun-Wei Lin
2022-05-31 13:06 ` Rob Herring
2022-05-31 20:43 ` Frank Rowand
2022-05-31 21:49 ` Rob Herring
2022-06-01 1:45 ` Frank Rowand
[not found] ` <b054866a5c043d3b6d5553057b5f5bf7b06681f0.camel@mediatek.com>
2022-06-02 3:07 ` Frank Rowand
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).