diff mbox series

[4/8] drm/bridge: ti-sn65dsi86: annotate ti_sn_pwm_pin_{request, release} with __maybe_unused

Message ID 136ecd978aedd7df39d1b1c37b70596027ff0a3e.1725962479.git.jani.nikula@intel.com (mailing list archive)
State New
Headers show
Series drm: fix and enable warnings on unused static inlines | expand

Commit Message

Jani Nikula Sept. 10, 2024, 10:03 a.m. UTC
Building with clang, W=1, CONFIG_PM=n and CONFIG_OF_GPIO=n leads to
warning about unused ti_sn_pwm_pin_request() and
ti_sn_pwm_pin_release(). Fix by annotating them with __maybe_unused.

See also commit 6863f5643dd7 ("kbuild: allow Clang to find unused static
inline functions for W=1 build").

Signed-off-by: Jani Nikula <jani.nikula@intel.com>

---

Cc: Douglas Anderson <dianders@chromium.org>
Cc: Andrzej Hajda <andrzej.hajda@intel.com>
Cc: Neil Armstrong <neil.armstrong@linaro.org>
Cc: Robert Foss <rfoss@kernel.org>
Cc: Laurent Pinchart <Laurent.pinchart@ideasonboard.com>
Cc: Jonas Karlman <jonas@kwiboo.se>
Cc: Jernej Skrabec <jernej.skrabec@gmail.com>
Cc: Nathan Chancellor <nathan@kernel.org>
---
 drivers/gpu/drm/bridge/ti-sn65dsi86.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Doug Anderson Sept. 10, 2024, 10:57 p.m. UTC | #1
Hi,

On Tue, Sep 10, 2024 at 3:04 AM Jani Nikula <jani.nikula@intel.com> wrote:
>
> Building with clang, W=1, CONFIG_PM=n and CONFIG_OF_GPIO=n leads to
> warning about unused ti_sn_pwm_pin_request() and
> ti_sn_pwm_pin_release(). Fix by annotating them with __maybe_unused.
>
> See also commit 6863f5643dd7 ("kbuild: allow Clang to find unused static
> inline functions for W=1 build").
>
> Signed-off-by: Jani Nikula <jani.nikula@intel.com>
>
> ---
>
> Cc: Douglas Anderson <dianders@chromium.org>
> Cc: Andrzej Hajda <andrzej.hajda@intel.com>
> Cc: Neil Armstrong <neil.armstrong@linaro.org>
> Cc: Robert Foss <rfoss@kernel.org>
> Cc: Laurent Pinchart <Laurent.pinchart@ideasonboard.com>
> Cc: Jonas Karlman <jonas@kwiboo.se>
> Cc: Jernej Skrabec <jernej.skrabec@gmail.com>
> Cc: Nathan Chancellor <nathan@kernel.org>
> ---
>  drivers/gpu/drm/bridge/ti-sn65dsi86.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)

Reviewed-by: Douglas Anderson <dianders@chromium.org>

I'm happy to land this in drm-misc-next unless there are any extra
dependencies. Let me know. In some sense I guess this could even be
considered a "Fix", though I guess given the history of the compiler
options that might be a bit of a stretch.

-Doug
Jani Nikula Sept. 11, 2024, 8:01 a.m. UTC | #2
On Tue, 10 Sep 2024, Doug Anderson <dianders@chromium.org> wrote:
> Hi,
>
> On Tue, Sep 10, 2024 at 3:04 AM Jani Nikula <jani.nikula@intel.com> wrote:
>>
>> Building with clang, W=1, CONFIG_PM=n and CONFIG_OF_GPIO=n leads to
>> warning about unused ti_sn_pwm_pin_request() and
>> ti_sn_pwm_pin_release(). Fix by annotating them with __maybe_unused.
>>
>> See also commit 6863f5643dd7 ("kbuild: allow Clang to find unused static
>> inline functions for W=1 build").
>>
>> Signed-off-by: Jani Nikula <jani.nikula@intel.com>
>>
>> ---
>>
>> Cc: Douglas Anderson <dianders@chromium.org>
>> Cc: Andrzej Hajda <andrzej.hajda@intel.com>
>> Cc: Neil Armstrong <neil.armstrong@linaro.org>
>> Cc: Robert Foss <rfoss@kernel.org>
>> Cc: Laurent Pinchart <Laurent.pinchart@ideasonboard.com>
>> Cc: Jonas Karlman <jonas@kwiboo.se>
>> Cc: Jernej Skrabec <jernej.skrabec@gmail.com>
>> Cc: Nathan Chancellor <nathan@kernel.org>
>> ---
>>  drivers/gpu/drm/bridge/ti-sn65dsi86.c | 4 ++--
>>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> Reviewed-by: Douglas Anderson <dianders@chromium.org>
>
> I'm happy to land this in drm-misc-next unless there are any extra
> dependencies. Let me know. In some sense I guess this could even be
> considered a "Fix", though I guess given the history of the compiler
> options that might be a bit of a stretch.

drm-misc-next is fine. Agree on not considering this a fix.

BR,
Jani.
Doug Anderson Sept. 11, 2024, 8:07 p.m. UTC | #3
Hi,

On Wed, Sep 11, 2024 at 1:02 AM Jani Nikula <jani.nikula@intel.com> wrote:
>
> On Tue, 10 Sep 2024, Doug Anderson <dianders@chromium.org> wrote:
> > Hi,
> >
> > On Tue, Sep 10, 2024 at 3:04 AM Jani Nikula <jani.nikula@intel.com> wrote:
> >>
> >> Building with clang, W=1, CONFIG_PM=n and CONFIG_OF_GPIO=n leads to
> >> warning about unused ti_sn_pwm_pin_request() and
> >> ti_sn_pwm_pin_release(). Fix by annotating them with __maybe_unused.
> >>
> >> See also commit 6863f5643dd7 ("kbuild: allow Clang to find unused static
> >> inline functions for W=1 build").
> >>
> >> Signed-off-by: Jani Nikula <jani.nikula@intel.com>
> >>
> >> ---
> >>
> >> Cc: Douglas Anderson <dianders@chromium.org>
> >> Cc: Andrzej Hajda <andrzej.hajda@intel.com>
> >> Cc: Neil Armstrong <neil.armstrong@linaro.org>
> >> Cc: Robert Foss <rfoss@kernel.org>
> >> Cc: Laurent Pinchart <Laurent.pinchart@ideasonboard.com>
> >> Cc: Jonas Karlman <jonas@kwiboo.se>
> >> Cc: Jernej Skrabec <jernej.skrabec@gmail.com>
> >> Cc: Nathan Chancellor <nathan@kernel.org>
> >> ---
> >>  drivers/gpu/drm/bridge/ti-sn65dsi86.c | 4 ++--
> >>  1 file changed, 2 insertions(+), 2 deletions(-)
> >
> > Reviewed-by: Douglas Anderson <dianders@chromium.org>
> >
> > I'm happy to land this in drm-misc-next unless there are any extra
> > dependencies. Let me know. In some sense I guess this could even be
> > considered a "Fix", though I guess given the history of the compiler
> > options that might be a bit of a stretch.
>
> drm-misc-next is fine. Agree on not considering this a fix.

It's only been on the list a day but it's simple so I just landed it
to drm-misc-next:

[4/8] drm/bridge: ti-sn65dsi86: annotate ti_sn_pwm_pin_{request,
release} with __maybe_unused
      commit: 868cd000c19f77e4c25ce87c47b6f951facf4394
diff mbox series

Patch

diff --git a/drivers/gpu/drm/bridge/ti-sn65dsi86.c b/drivers/gpu/drm/bridge/ti-sn65dsi86.c
index 84698a0b27a8..0fd4cb400e81 100644
--- a/drivers/gpu/drm/bridge/ti-sn65dsi86.c
+++ b/drivers/gpu/drm/bridge/ti-sn65dsi86.c
@@ -1635,8 +1635,8 @@  static void ti_sn_pwm_unregister(void)
 }
 
 #else
-static inline int ti_sn_pwm_pin_request(struct ti_sn65dsi86 *pdata) { return 0; }
-static inline void ti_sn_pwm_pin_release(struct ti_sn65dsi86 *pdata) {}
+static inline int __maybe_unused ti_sn_pwm_pin_request(struct ti_sn65dsi86 *pdata) { return 0; }
+static inline void __maybe_unused ti_sn_pwm_pin_release(struct ti_sn65dsi86 *pdata) {}
 
 static inline int ti_sn_pwm_register(void) { return 0; }
 static inline void ti_sn_pwm_unregister(void) {}