[PATCH RESEND] drm/rockchip: cdn-dp-core: Fix cdn_dp_resume unused warning

Arnd Bergmann arnd at arndb.de
Tue Sep 7 01:17:32 PDT 2021


On Tue, Sep 7, 2021 at 9:02 AM Geert Uytterhoeven <geert at linux-m68k.org> wrote:
> On Mon, Sep 6, 2021 at 9:58 PM Palmer Dabbelt <palmer at dabbelt.com> wrote:
> > From: Palmer Dabbelt <palmerdabbelt at google.com>

> >
> > +#ifdef CONFIG_PM_SLEEP
> >  static int cdn_dp_resume(struct device *dev)
>
> An alternative solution would be to tag the function with
> __maybe_unused.

Right. In this case, both are correct, but generally speaking I tend to use the
__maybe_unused variant because it's more reliable at fixing the warning for
good when there are additional functions called by the suspend/resume
helpers that now become unused in some configurations, or when you pick
the wrong set of #ifdefs.

Having fewer #ifdef checks also helps with build coverage testing when there
is a warning inside of an #ifdef.

       Arnd



More information about the Linux-rockchip mailing list