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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Sep 7, 2021 at 9:02 AM Geert Uytterhoeven <geert@xxxxxxxxxxxxxx> wrote:
> On Mon, Sep 6, 2021 at 9:58 PM Palmer Dabbelt <palmer@xxxxxxxxxxx> wrote:
> > From: Palmer Dabbelt <palmerdabbelt@xxxxxxxxxx>

> >
> > +#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



[Index of Archives]     [Linux DRI Users]     [Linux Intel Graphics]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux