Thread (3 messages) 3 messages, 3 authors, 2021-09-07

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

flat view

From: Arnd Bergmann <arnd@arndb.de>
Date: 2021-09-07 08:18:00
Also in: dri-devel, linux-rockchip, lkml

On Tue, Sep 7, 2021 at 9:02 AM Geert Uytterhoeven [off-list ref] wrote:
On Mon, Sep 6, 2021 at 9:58 PM Palmer Dabbelt [off-list ref] wrote:
quoted
From: Palmer Dabbelt <redacted>
quoted
+#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

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help