[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAL_JsqLNq6DcLkJm=vSaGKs0cyup5Y6VpQFOWs+-+KeO0qyVJw@mail.gmail.com>
Date: Wed, 23 Apr 2025 17:10:36 -0500
From: Rob Herring <robh@...nel.org>
To: Robin Murphy <robin.murphy@....com>
Cc: Liya Huang <1425075683@...com>, Saravana Kannan <saravanak@...gle.com>, devicetree@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH] of: Build warn for missing fn() in _OF_DECLARE
On Wed, Apr 23, 2025 at 7:18 AM Robin Murphy <robin.murphy@....com> wrote:
>
> On 2025-04-17 2:23 pm, Liya Huang wrote:
> > The function pointer fn() in _OF_DECLARE macro might be NULL. For example,
> > in __reserved_mem_init_node(), only non-NULL cases are handled, and NULL
> > function pointers are ignored.
> >
> > This patch introduces a check to handle cases where fn() is NULL. If fn()
> > is found to be NULL, a warning is issued during compilation to notify
> > developers about the missing function pointer.
> >
> > ---
> > The function pointer fn() in _OF_DECLARE macro might be NULL. For example,
> > in __reserved_mem_init_node(), only non-NULL cases are handled, and NULL
> > function pointers are ignored.
> >
> > This patch introduces a check to handle cases where fn() is NULL. If fn()
> > is found to be NULL, a warning is issued during compilation to notify
> > developers about the missing function pointer.
>
> This patch in -next appears to be responsible for syzbot complaining
> about build errors for some configs:
>
> "
> kernel/dma/coherent.c:410:1: error: static assertion expression is not
> an integral constant expression
> kernel/dma/contiguous.c:497:1: error: static assertion expression is not
> an integral constant expression
> "
>
> https://lore.kernel.org/linux-iommu/6808d00a.050a0220.7184a.0010.GAE@google.com/
Humm, doesn't seem to repro for me with clang-19.
>
> Also on closer inspection, just outside the diff context we still seem
> to be explicitly anticipating fn being NULL with:
>
> .data = (fn == (fn_type)NULL) ? fn : fn
No, that is checking that the function parameters match the defined
type. If fn's type doesn't match fn_type, then you get a compiler
error.
Anyway, dropping it for now.
Rob
Powered by blists - more mailing lists