[PATCH] scripts: dtc: fix a false alarm for node_name_chars_strict
qun-wei.lin
qun-wei.lin at mediatek.com
Wed Jun 1 06:58:28 PDT 2022
On Tue, 2022-05-31 at 08:06 -0500, Rob Herring wrote:
> On Tue, May 31, 2022 at 12:34 AM Qun-Wei Lin <
> qun-wei.lin at mediatek.com> wrote:
> >
> > The function check_node_name_chars_strict issues a false alarm when
> > compiling an overlay dts.
> >
> > /fragment at 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 at 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.
Ok, I'll send this patch to the correct upstream.
>
> > 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
> '__'.
Did you mean it needs to skip the check for all nodes whose names start
with "_", such as __overlay__, __fixup__, __local_fixup__, and
__symbols__?
>
> Also, doesn't 'fragment at 0' cause a warning about missing 'reg'?
No, it doesn't.
Actually, the check_unit_address_vs_reg function suppress the common
warnings about the fragment names [1].
[1]
https://github.com/dgibson/dtc/commit/afbddcd418fbf70467419b91f73cce972482449c
More information about the Linux-mediatek
mailing list