dri-devel.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/8] drm: fix and enable warnings on unused static inlines
@ 2024-09-10 10:03 Jani Nikula
  2024-09-10 10:03 ` [PATCH 1/8] drm/bridge: dw-hdmi-i2s: annotate hdmi_read() with __maybe_unused Jani Nikula
                   ` (8 more replies)
  0 siblings, 9 replies; 35+ messages in thread
From: Jani Nikula @ 2024-09-10 10:03 UTC (permalink / raw)
  To: dri-devel; +Cc: intel-gfx, intel-xe, jani.nikula, Nathan Chancellor

Follow-up to [1].

Annotate unused static inlines with __maybe_unused. In some cases it
might be better to remove them, but it's really up to the maintainers
what to do. Then enable the warning on default across subsystem.

BR,
Jani.

[1] https://lore.kernel.org/r/20240904123819.3784906-1-jani.nikula@intel.com


Jani Nikula (8):
  drm/bridge: dw-hdmi-i2s: annotate hdmi_read() with __maybe_unused
  drm: renesas: rcar-du: annotate rcar_cmm_read() with __maybe_unused
  drm/kmb: annotate set_test_mode_src_osc_freq_target_{low,hi}_bits()
    with __maybe_unused
  drm/bridge: ti-sn65dsi86: annotate ti_sn_pwm_pin_{request,release}
    with __maybe_unused
  drm/imagination: annotate pvr_fw_version_packed() with __maybe_unused
  drm/meson: dw-hdmi: annotate dw_hdmi_dwc_write_bits() with
    __maybe_unused
  drm/msmi: annotate pll_cmp_to_fdata() with __maybe_unused
  drm: enable warnings on unused static inlines

 drivers/gpu/drm/Makefile                            | 3 +++
 drivers/gpu/drm/bridge/synopsys/dw-hdmi-i2s-audio.c | 2 +-
 drivers/gpu/drm/bridge/ti-sn65dsi86.c               | 4 ++--
 drivers/gpu/drm/imagination/pvr_drv.c               | 2 +-
 drivers/gpu/drm/kmb/kmb_dsi.c                       | 4 ++--
 drivers/gpu/drm/meson/meson_dw_hdmi.c               | 8 ++++----
 drivers/gpu/drm/msm/hdmi/hdmi_phy_8998.c            | 2 +-
 drivers/gpu/drm/renesas/rcar-du/rcar_cmm.c          | 2 +-
 8 files changed, 15 insertions(+), 12 deletions(-)

-- 
2.39.2


^ permalink raw reply	[flat|nested] 35+ messages in thread

* [PATCH 1/8] drm/bridge: dw-hdmi-i2s: annotate hdmi_read() with __maybe_unused
  2024-09-10 10:03 [PATCH 0/8] drm: fix and enable warnings on unused static inlines Jani Nikula
@ 2024-09-10 10:03 ` Jani Nikula
  2024-09-10 10:03 ` [PATCH 2/8] drm: renesas: rcar-du: annotate rcar_cmm_read() " Jani Nikula
                   ` (7 subsequent siblings)
  8 siblings, 0 replies; 35+ messages in thread
From: Jani Nikula @ 2024-09-10 10:03 UTC (permalink / raw)
  To: dri-devel
  Cc: intel-gfx, intel-xe, jani.nikula, Nathan Chancellor,
	Andrzej Hajda, Neil Armstrong, Robert Foss, Laurent Pinchart,
	Jonas Karlman, Jernej Skrabec

Building with clang and and W=1 leads to warning about unused
hdmi_read(). Fix by annotating it 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: 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/synopsys/dw-hdmi-i2s-audio.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/bridge/synopsys/dw-hdmi-i2s-audio.c b/drivers/gpu/drm/bridge/synopsys/dw-hdmi-i2s-audio.c
index 26c187d20d97..4377f9d89a82 100644
--- a/drivers/gpu/drm/bridge/synopsys/dw-hdmi-i2s-audio.c
+++ b/drivers/gpu/drm/bridge/synopsys/dw-hdmi-i2s-audio.c
@@ -27,7 +27,7 @@ static inline void hdmi_write(struct dw_hdmi_i2s_audio_data *audio,
 	audio->write(hdmi, val, offset);
 }
 
-static inline u8 hdmi_read(struct dw_hdmi_i2s_audio_data *audio, int offset)
+static inline __maybe_unused u8 hdmi_read(struct dw_hdmi_i2s_audio_data *audio, int offset)
 {
 	struct dw_hdmi *hdmi = audio->hdmi;
 
-- 
2.39.2


^ permalink raw reply related	[flat|nested] 35+ messages in thread

* [PATCH 2/8] drm: renesas: rcar-du: annotate rcar_cmm_read() with __maybe_unused
  2024-09-10 10:03 [PATCH 0/8] drm: fix and enable warnings on unused static inlines Jani Nikula
  2024-09-10 10:03 ` [PATCH 1/8] drm/bridge: dw-hdmi-i2s: annotate hdmi_read() with __maybe_unused Jani Nikula
@ 2024-09-10 10:03 ` Jani Nikula
  2024-09-10 12:39   ` Geert Uytterhoeven
  2024-09-10 10:03 ` [PATCH 3/8] drm/kmb: annotate set_test_mode_src_osc_freq_target_{low, hi}_bits() " Jani Nikula
                   ` (6 subsequent siblings)
  8 siblings, 1 reply; 35+ messages in thread
From: Jani Nikula @ 2024-09-10 10:03 UTC (permalink / raw)
  To: dri-devel
  Cc: intel-gfx, intel-xe, jani.nikula, Nathan Chancellor,
	Laurent Pinchart, Kieran Bingham, linux-renesas-soc

Building with clang and and W=1 leads to warning about unused
rcar_cmm_read(). Fix by annotating it 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: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Cc: Kieran Bingham <kieran.bingham+renesas@ideasonboard.com>
Cc: linux-renesas-soc@vger.kernel.org
Cc: Nathan Chancellor <nathan@kernel.org>
---
 drivers/gpu/drm/renesas/rcar-du/rcar_cmm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/renesas/rcar-du/rcar_cmm.c b/drivers/gpu/drm/renesas/rcar-du/rcar_cmm.c
index 26a2f5ad8ee5..ea52b0af9226 100644
--- a/drivers/gpu/drm/renesas/rcar-du/rcar_cmm.c
+++ b/drivers/gpu/drm/renesas/rcar-du/rcar_cmm.c
@@ -32,7 +32,7 @@ struct rcar_cmm {
 	} lut;
 };
 
-static inline int rcar_cmm_read(struct rcar_cmm *rcmm, u32 reg)
+static inline __maybe_unused int rcar_cmm_read(struct rcar_cmm *rcmm, u32 reg)
 {
 	return ioread32(rcmm->base + reg);
 }
-- 
2.39.2


^ permalink raw reply related	[flat|nested] 35+ messages in thread

* [PATCH 3/8] drm/kmb: annotate set_test_mode_src_osc_freq_target_{low, hi}_bits() with __maybe_unused
  2024-09-10 10:03 [PATCH 0/8] drm: fix and enable warnings on unused static inlines Jani Nikula
  2024-09-10 10:03 ` [PATCH 1/8] drm/bridge: dw-hdmi-i2s: annotate hdmi_read() with __maybe_unused Jani Nikula
  2024-09-10 10:03 ` [PATCH 2/8] drm: renesas: rcar-du: annotate rcar_cmm_read() " Jani Nikula
@ 2024-09-10 10:03 ` Jani Nikula
  2024-09-10 18:11   ` [PATCH 3/8] drm/kmb: annotate set_test_mode_src_osc_freq_target_{low,hi}_bits() " Chrisanthus, Anitha
  2024-09-10 10:03 ` [PATCH 4/8] drm/bridge: ti-sn65dsi86: annotate ti_sn_pwm_pin_{request, release} " Jani Nikula
                   ` (5 subsequent siblings)
  8 siblings, 1 reply; 35+ messages in thread
From: Jani Nikula @ 2024-09-10 10:03 UTC (permalink / raw)
  To: dri-devel
  Cc: intel-gfx, intel-xe, jani.nikula, Nathan Chancellor,
	Anitha Chrisanthus, Edmund Dea

Building with clang and and W=1 leads to warning about unused
set_test_mode_src_osc_freq_target_low_bits() and
set_test_mode_src_osc_freq_target_hi_bits(). 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: Anitha Chrisanthus <anitha.chrisanthus@intel.com>
Cc: Edmund Dea <edmund.j.dea@intel.com>
Cc: Nathan Chancellor <nathan@kernel.org>
---
 drivers/gpu/drm/kmb/kmb_dsi.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/kmb/kmb_dsi.c b/drivers/gpu/drm/kmb/kmb_dsi.c
index cf7cf0b07541..faf38ca9e44c 100644
--- a/drivers/gpu/drm/kmb/kmb_dsi.c
+++ b/drivers/gpu/drm/kmb/kmb_dsi.c
@@ -818,7 +818,7 @@ static void test_mode_send(struct kmb_dsi *kmb_dsi, u32 dphy_no,
 	}
 }
 
-static inline void
+static inline __maybe_unused void
 	set_test_mode_src_osc_freq_target_low_bits(struct kmb_dsi *kmb_dsi,
 						   u32 dphy_no,
 						   u32 freq)
@@ -830,7 +830,7 @@ static inline void
 		       (freq & 0x7f));
 }
 
-static inline void
+static inline __maybe_unused void
 	set_test_mode_src_osc_freq_target_hi_bits(struct kmb_dsi *kmb_dsi,
 						  u32 dphy_no,
 						  u32 freq)
-- 
2.39.2


^ permalink raw reply related	[flat|nested] 35+ messages in thread

* [PATCH 4/8] drm/bridge: ti-sn65dsi86: annotate ti_sn_pwm_pin_{request, release} with __maybe_unused
  2024-09-10 10:03 [PATCH 0/8] drm: fix and enable warnings on unused static inlines Jani Nikula
                   ` (2 preceding siblings ...)
  2024-09-10 10:03 ` [PATCH 3/8] drm/kmb: annotate set_test_mode_src_osc_freq_target_{low, hi}_bits() " Jani Nikula
@ 2024-09-10 10:03 ` Jani Nikula
  2024-09-10 22:57   ` Doug Anderson
  2024-09-10 10:03 ` [PATCH 5/8] drm/imagination: annotate pvr_fw_version_packed() " Jani Nikula
                   ` (4 subsequent siblings)
  8 siblings, 1 reply; 35+ messages in thread
From: Jani Nikula @ 2024-09-10 10:03 UTC (permalink / raw)
  To: dri-devel
  Cc: intel-gfx, intel-xe, jani.nikula, Nathan Chancellor,
	Douglas Anderson, Andrzej Hajda, Neil Armstrong, Robert Foss,
	Laurent Pinchart, Jonas Karlman, Jernej Skrabec

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(-)

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) {}
-- 
2.39.2


^ permalink raw reply related	[flat|nested] 35+ messages in thread

* [PATCH 5/8] drm/imagination: annotate pvr_fw_version_packed() with __maybe_unused
  2024-09-10 10:03 [PATCH 0/8] drm: fix and enable warnings on unused static inlines Jani Nikula
                   ` (3 preceding siblings ...)
  2024-09-10 10:03 ` [PATCH 4/8] drm/bridge: ti-sn65dsi86: annotate ti_sn_pwm_pin_{request, release} " Jani Nikula
@ 2024-09-10 10:03 ` Jani Nikula
  2024-09-10 10:40   ` Matt Coster
  2024-09-10 10:03 ` [PATCH 6/8] drm/meson: dw-hdmi: annotate dw_hdmi_dwc_write_bits() " Jani Nikula
                   ` (3 subsequent siblings)
  8 siblings, 1 reply; 35+ messages in thread
From: Jani Nikula @ 2024-09-10 10:03 UTC (permalink / raw)
  To: dri-devel
  Cc: intel-gfx, intel-xe, jani.nikula, Nathan Chancellor, Frank Binns,
	Matt Coster

Building with clang and and W=1 leads to warning about unused
pvr_fw_version_packed(). Fix by annotating it 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: Frank Binns <frank.binns@imgtec.com>
Cc: Matt Coster <matt.coster@imgtec.com>
Cc: Nathan Chancellor <nathan@kernel.org>
---
 drivers/gpu/drm/imagination/pvr_drv.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/imagination/pvr_drv.c b/drivers/gpu/drm/imagination/pvr_drv.c
index 1a0cb7aa9cea..684a9b9a2247 100644
--- a/drivers/gpu/drm/imagination/pvr_drv.c
+++ b/drivers/gpu/drm/imagination/pvr_drv.c
@@ -220,7 +220,7 @@ pvr_ioctl_get_bo_mmap_offset(struct drm_device *drm_dev, void *raw_args,
 	return ret;
 }
 
-static __always_inline u64
+static __always_inline __maybe_unused u64
 pvr_fw_version_packed(u32 major, u32 minor)
 {
 	return ((u64)major << 32) | minor;
-- 
2.39.2


^ permalink raw reply related	[flat|nested] 35+ messages in thread

* [PATCH 6/8] drm/meson: dw-hdmi: annotate dw_hdmi_dwc_write_bits() with __maybe_unused
  2024-09-10 10:03 [PATCH 0/8] drm: fix and enable warnings on unused static inlines Jani Nikula
                   ` (4 preceding siblings ...)
  2024-09-10 10:03 ` [PATCH 5/8] drm/imagination: annotate pvr_fw_version_packed() " Jani Nikula
@ 2024-09-10 10:03 ` Jani Nikula
  2024-09-15 19:35   ` Martin Blumenstingl
  2024-09-10 10:03 ` [PATCH 7/8] drm/msmi: annotate pll_cmp_to_fdata() " Jani Nikula
                   ` (2 subsequent siblings)
  8 siblings, 1 reply; 35+ messages in thread
From: Jani Nikula @ 2024-09-10 10:03 UTC (permalink / raw)
  To: dri-devel
  Cc: intel-gfx, intel-xe, jani.nikula, Nathan Chancellor,
	Neil Armstrong, linux-amlogic

Building with clang and and W=1 leads to warning about unused
dw_hdmi_dwc_write_bits(). Fix by annotating it 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: Neil Armstrong <neil.armstrong@linaro.org>
Cc: linux-amlogic@lists.infradead.org
Cc: Nathan Chancellor <nathan@kernel.org>
---
 drivers/gpu/drm/meson/meson_dw_hdmi.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/gpu/drm/meson/meson_dw_hdmi.c b/drivers/gpu/drm/meson/meson_dw_hdmi.c
index 5565f7777529..8d99d70a36e3 100644
--- a/drivers/gpu/drm/meson/meson_dw_hdmi.c
+++ b/drivers/gpu/drm/meson/meson_dw_hdmi.c
@@ -273,10 +273,10 @@ static inline void dw_hdmi_g12a_dwc_write(struct meson_dw_hdmi *dw_hdmi,
 }
 
 /* Helper to change specific bits in controller registers */
-static inline void dw_hdmi_dwc_write_bits(struct meson_dw_hdmi *dw_hdmi,
-					  unsigned int addr,
-					  unsigned int mask,
-					  unsigned int val)
+static inline __maybe_unused void dw_hdmi_dwc_write_bits(struct meson_dw_hdmi *dw_hdmi,
+							 unsigned int addr,
+							 unsigned int mask,
+							 unsigned int val)
 {
 	unsigned int data = dw_hdmi->data->dwc_read(dw_hdmi, addr);
 
-- 
2.39.2


^ permalink raw reply related	[flat|nested] 35+ messages in thread

* [PATCH 7/8] drm/msmi: annotate pll_cmp_to_fdata() with __maybe_unused
  2024-09-10 10:03 [PATCH 0/8] drm: fix and enable warnings on unused static inlines Jani Nikula
                   ` (5 preceding siblings ...)
  2024-09-10 10:03 ` [PATCH 6/8] drm/meson: dw-hdmi: annotate dw_hdmi_dwc_write_bits() " Jani Nikula
@ 2024-09-10 10:03 ` Jani Nikula
  2024-09-10 14:51   ` Dmitry Baryshkov
  2024-09-10 10:03 ` [PATCH 8/8] drm: enable warnings on unused static inlines Jani Nikula
  2024-09-11 17:46 ` [PATCH 0/8] drm: fix and " Nathan Chancellor
  8 siblings, 1 reply; 35+ messages in thread
From: Jani Nikula @ 2024-09-10 10:03 UTC (permalink / raw)
  To: dri-devel
  Cc: intel-gfx, intel-xe, jani.nikula, Nathan Chancellor, Rob Clark,
	Abhinav Kumar, Dmitry Baryshkov, Sean Paul, Marijn Suijten,
	linux-arm-msm

Building with clang and and W=1 leads to warning about unused
pll_cmp_to_fdata(). Fix by annotating it 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: Rob Clark <robdclark@gmail.com>
Cc: Abhinav Kumar <quic_abhinavk@quicinc.com>
Cc: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Cc: Sean Paul <sean@poorly.run>
Cc: Marijn Suijten <marijn.suijten@somainline.org>
Cc: linux-arm-msm@vger.kernel.org
Cc: Nathan Chancellor <nathan@kernel.org>
---
 drivers/gpu/drm/msm/hdmi/hdmi_phy_8998.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/msm/hdmi/hdmi_phy_8998.c b/drivers/gpu/drm/msm/hdmi/hdmi_phy_8998.c
index 0e3a2b16a2ce..c0bf1f35539e 100644
--- a/drivers/gpu/drm/msm/hdmi/hdmi_phy_8998.c
+++ b/drivers/gpu/drm/msm/hdmi/hdmi_phy_8998.c
@@ -153,7 +153,7 @@ static inline u32 pll_get_pll_cmp(u64 fdata, unsigned long ref_clk)
 	return dividend - 1;
 }
 
-static inline u64 pll_cmp_to_fdata(u32 pll_cmp, unsigned long ref_clk)
+static inline __maybe_unused u64 pll_cmp_to_fdata(u32 pll_cmp, unsigned long ref_clk)
 {
 	u64 fdata = ((u64)pll_cmp) * ref_clk * 10;
 
-- 
2.39.2


^ permalink raw reply related	[flat|nested] 35+ messages in thread

* [PATCH 8/8] drm: enable warnings on unused static inlines
  2024-09-10 10:03 [PATCH 0/8] drm: fix and enable warnings on unused static inlines Jani Nikula
                   ` (6 preceding siblings ...)
  2024-09-10 10:03 ` [PATCH 7/8] drm/msmi: annotate pll_cmp_to_fdata() " Jani Nikula
@ 2024-09-10 10:03 ` Jani Nikula
  2024-09-11 17:46 ` [PATCH 0/8] drm: fix and " Nathan Chancellor
  8 siblings, 0 replies; 35+ messages in thread
From: Jani Nikula @ 2024-09-10 10:03 UTC (permalink / raw)
  To: dri-devel; +Cc: intel-gfx, intel-xe, jani.nikula, Nathan Chancellor

We enable most W=1 warnings by default subsystem wide. Also enable
warnings on unused static inlines when building with clang.

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

Cc: Nathan Chancellor <nathan@kernel.org>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
---
 drivers/gpu/drm/Makefile | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/gpu/drm/Makefile b/drivers/gpu/drm/Makefile
index 784229d4504d..6bd2cdb08be7 100644
--- a/drivers/gpu/drm/Makefile
+++ b/drivers/gpu/drm/Makefile
@@ -19,6 +19,9 @@ subdir-ccflags-y += $(call cc-option, -Wformat-overflow)
 # FIXME: fix -Wformat-truncation warnings and uncomment
 #subdir-ccflags-y += $(call cc-option, -Wformat-truncation)
 subdir-ccflags-y += $(call cc-option, -Wstringop-truncation)
+
+subdir-ccflags-y += -DKBUILD_EXTRA_WARN1
+
 # The following turn off the warnings enabled by -Wextra
 ifeq ($(findstring 2, $(KBUILD_EXTRA_WARN)),)
 subdir-ccflags-y += -Wno-missing-field-initializers
-- 
2.39.2


^ permalink raw reply related	[flat|nested] 35+ messages in thread

* Re: [PATCH 5/8] drm/imagination: annotate pvr_fw_version_packed() with __maybe_unused
  2024-09-10 10:03 ` [PATCH 5/8] drm/imagination: annotate pvr_fw_version_packed() " Jani Nikula
@ 2024-09-10 10:40   ` Matt Coster
  2024-09-13 11:47     ` Jani Nikula
  0 siblings, 1 reply; 35+ messages in thread
From: Matt Coster @ 2024-09-10 10:40 UTC (permalink / raw)
  To: Jani Nikula, dri-devel@lists.freedesktop.org
  Cc: intel-gfx@lists.freedesktop.org, intel-xe@lists.freedesktop.org,
	Nathan Chancellor, Frank Binns


[-- Attachment #1.1: Type: text/plain, Size: 1319 bytes --]

On 10/09/2024 11:03, Jani Nikula wrote:
> Building with clang and and W=1 leads to warning about unused
> pvr_fw_version_packed(). Fix by annotating it 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>

I've been meaning to do something about this for a while, thanks!

Reviewed-by: Matt Coster <matt.coster@imgtec.com>

Cheers,
Matt

-- 
Matt Coster
E: matt.coster@imgtec.com

> ---
> 
> Cc: Frank Binns <frank.binns@imgtec.com>
> Cc: Matt Coster <matt.coster@imgtec.com>
> Cc: Nathan Chancellor <nathan@kernel.org>
> ---
>  drivers/gpu/drm/imagination/pvr_drv.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/imagination/pvr_drv.c b/drivers/gpu/drm/imagination/pvr_drv.c
> index 1a0cb7aa9cea..684a9b9a2247 100644
> --- a/drivers/gpu/drm/imagination/pvr_drv.c
> +++ b/drivers/gpu/drm/imagination/pvr_drv.c
> @@ -220,7 +220,7 @@ pvr_ioctl_get_bo_mmap_offset(struct drm_device *drm_dev, void *raw_args,
>  	return ret;
>  }
>  
> -static __always_inline u64
> +static __always_inline __maybe_unused u64
>  pvr_fw_version_packed(u32 major, u32 minor)
>  {
>  	return ((u64)major << 32) | minor;

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 236 bytes --]

^ permalink raw reply	[flat|nested] 35+ messages in thread

* Re: [PATCH 2/8] drm: renesas: rcar-du: annotate rcar_cmm_read() with __maybe_unused
  2024-09-10 10:03 ` [PATCH 2/8] drm: renesas: rcar-du: annotate rcar_cmm_read() " Jani Nikula
@ 2024-09-10 12:39   ` Geert Uytterhoeven
  2024-09-10 13:36     ` Jani Nikula
  0 siblings, 1 reply; 35+ messages in thread
From: Geert Uytterhoeven @ 2024-09-10 12:39 UTC (permalink / raw)
  To: Jani Nikula
  Cc: dri-devel, intel-gfx, intel-xe, Nathan Chancellor,
	Laurent Pinchart, Kieran Bingham, linux-renesas-soc

Hi Jani,

On Tue, Sep 10, 2024 at 12:06 PM Jani Nikula <jani.nikula@intel.com> wrote:
> Building with clang and and W=1 leads to warning about unused
> rcar_cmm_read(). Fix by annotating it 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>

Thanks for your patch!

> --- a/drivers/gpu/drm/renesas/rcar-du/rcar_cmm.c
> +++ b/drivers/gpu/drm/renesas/rcar-du/rcar_cmm.c
> @@ -32,7 +32,7 @@ struct rcar_cmm {
>         } lut;
>  };
>
> -static inline int rcar_cmm_read(struct rcar_cmm *rcmm, u32 reg)
> +static inline __maybe_unused int rcar_cmm_read(struct rcar_cmm *rcmm, u32 reg)
>  {
>         return ioread32(rcmm->base + reg);
>  }

This function was never used. Why not remove it instead?

Gr{oetje,eeting}s,

                        Geert

-- 
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

^ permalink raw reply	[flat|nested] 35+ messages in thread

* Re: [PATCH 2/8] drm: renesas: rcar-du: annotate rcar_cmm_read() with __maybe_unused
  2024-09-10 12:39   ` Geert Uytterhoeven
@ 2024-09-10 13:36     ` Jani Nikula
  2024-09-11  9:51       ` Laurent Pinchart
  0 siblings, 1 reply; 35+ messages in thread
From: Jani Nikula @ 2024-09-10 13:36 UTC (permalink / raw)
  To: Geert Uytterhoeven
  Cc: dri-devel, intel-gfx, intel-xe, Nathan Chancellor,
	Laurent Pinchart, Kieran Bingham, linux-renesas-soc

On Tue, 10 Sep 2024, Geert Uytterhoeven <geert@linux-m68k.org> wrote:
> Hi Jani,
>
> On Tue, Sep 10, 2024 at 12:06 PM Jani Nikula <jani.nikula@intel.com> wrote:
>> Building with clang and and W=1 leads to warning about unused
>> rcar_cmm_read(). Fix by annotating it 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>
>
> Thanks for your patch!
>
>> --- a/drivers/gpu/drm/renesas/rcar-du/rcar_cmm.c
>> +++ b/drivers/gpu/drm/renesas/rcar-du/rcar_cmm.c
>> @@ -32,7 +32,7 @@ struct rcar_cmm {
>>         } lut;
>>  };
>>
>> -static inline int rcar_cmm_read(struct rcar_cmm *rcmm, u32 reg)
>> +static inline __maybe_unused int rcar_cmm_read(struct rcar_cmm *rcmm, u32 reg)
>>  {
>>         return ioread32(rcmm->base + reg);
>>  }
>
> This function was never used. Why not remove it instead?

Can do if that's what the maintainers desire. It's just that sometimes
it's better to have the implementation reviewed and ready waiting for
the users than requiring the first user to add the implementation. I
opted for __maybe_unused across the series.

BR,
Jani.

>
> Gr{oetje,eeting}s,
>
>                         Geert

-- 
Jani Nikula, Intel

^ permalink raw reply	[flat|nested] 35+ messages in thread

* Re: [PATCH 7/8] drm/msmi: annotate pll_cmp_to_fdata() with __maybe_unused
  2024-09-10 10:03 ` [PATCH 7/8] drm/msmi: annotate pll_cmp_to_fdata() " Jani Nikula
@ 2024-09-10 14:51   ` Dmitry Baryshkov
  2024-09-10 15:54     ` Marc Gonzalez
  0 siblings, 1 reply; 35+ messages in thread
From: Dmitry Baryshkov @ 2024-09-10 14:51 UTC (permalink / raw)
  To: Jani Nikula, Marc Gonzalez
  Cc: dri-devel, intel-gfx, intel-xe, Nathan Chancellor, Rob Clark,
	Abhinav Kumar, Sean Paul, Marijn Suijten, linux-arm-msm

On Tue, Sep 10, 2024 at 01:03:43PM GMT, Jani Nikula wrote:
> Building with clang and and W=1 leads to warning about unused
> pll_cmp_to_fdata(). Fix by annotating it 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>

I think this function can be dropped. Marc, your call, as an author of
the patch?

> 
> ---
> 
> Cc: Rob Clark <robdclark@gmail.com>
> Cc: Abhinav Kumar <quic_abhinavk@quicinc.com>
> Cc: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
> Cc: Sean Paul <sean@poorly.run>
> Cc: Marijn Suijten <marijn.suijten@somainline.org>
> Cc: linux-arm-msm@vger.kernel.org
> Cc: Nathan Chancellor <nathan@kernel.org>
> ---
>  drivers/gpu/drm/msm/hdmi/hdmi_phy_8998.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/msm/hdmi/hdmi_phy_8998.c b/drivers/gpu/drm/msm/hdmi/hdmi_phy_8998.c
> index 0e3a2b16a2ce..c0bf1f35539e 100644
> --- a/drivers/gpu/drm/msm/hdmi/hdmi_phy_8998.c
> +++ b/drivers/gpu/drm/msm/hdmi/hdmi_phy_8998.c
> @@ -153,7 +153,7 @@ static inline u32 pll_get_pll_cmp(u64 fdata, unsigned long ref_clk)
>  	return dividend - 1;
>  }
>  
> -static inline u64 pll_cmp_to_fdata(u32 pll_cmp, unsigned long ref_clk)
> +static inline __maybe_unused u64 pll_cmp_to_fdata(u32 pll_cmp, unsigned long ref_clk)
>  {
>  	u64 fdata = ((u64)pll_cmp) * ref_clk * 10;
>  
> -- 
> 2.39.2
> 

-- 
With best wishes
Dmitry

^ permalink raw reply	[flat|nested] 35+ messages in thread

* Re: [PATCH 7/8] drm/msmi: annotate pll_cmp_to_fdata() with __maybe_unused
  2024-09-10 14:51   ` Dmitry Baryshkov
@ 2024-09-10 15:54     ` Marc Gonzalez
  2024-09-11 10:23       ` Jani Nikula
  0 siblings, 1 reply; 35+ messages in thread
From: Marc Gonzalez @ 2024-09-10 15:54 UTC (permalink / raw)
  To: Dmitry Baryshkov, Jani Nikula, Arnaud Vrac
  Cc: dri-devel, intel-gfx, intel-xe, Nathan Chancellor, Rob Clark,
	Abhinav Kumar, Sean Paul, Marijn Suijten, linux-arm-msm

On 10/09/2024 16:51, Dmitry Baryshkov wrote:

> On Tue, Sep 10, 2024 at 01:03:43PM GMT, Jani Nikula wrote:
>
>> Building with clang and and W=1 leads to warning about unused
>> pll_cmp_to_fdata(). Fix by annotating it 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>
> 
> I think this function can be dropped. Marc, your call, as an author of
> the patch?

( Why is the patch prefixed "drm/msmi", is "msmi" a typo? )

-> For the record, Arnaud is the driver's author.

pll_cmp_to_fdata() was used in hdmi_8998_pll_recalc_rate()
in a commented code block which was later removed.

Thus, yes, it is safe to completely delete the unused function.
I'm surprised gcc didn't catch that...

Regards


>> ---
>>  drivers/gpu/drm/msm/hdmi/hdmi_phy_8998.c | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/drivers/gpu/drm/msm/hdmi/hdmi_phy_8998.c b/drivers/gpu/drm/msm/hdmi/hdmi_phy_8998.c
>> index 0e3a2b16a2ce..c0bf1f35539e 100644
>> --- a/drivers/gpu/drm/msm/hdmi/hdmi_phy_8998.c
>> +++ b/drivers/gpu/drm/msm/hdmi/hdmi_phy_8998.c
>> @@ -153,7 +153,7 @@ static inline u32 pll_get_pll_cmp(u64 fdata, unsigned long ref_clk)
>>  	return dividend - 1;
>>  }
>>  
>> -static inline u64 pll_cmp_to_fdata(u32 pll_cmp, unsigned long ref_clk)
>> +static inline __maybe_unused u64 pll_cmp_to_fdata(u32 pll_cmp, unsigned long ref_clk)
>>  {
>>  	u64 fdata = ((u64)pll_cmp) * ref_clk * 10;
>>  
>> -- 
>> 2.39.2



^ permalink raw reply	[flat|nested] 35+ messages in thread

* RE: [PATCH 3/8] drm/kmb: annotate set_test_mode_src_osc_freq_target_{low,hi}_bits() with __maybe_unused
  2024-09-10 10:03 ` [PATCH 3/8] drm/kmb: annotate set_test_mode_src_osc_freq_target_{low, hi}_bits() " Jani Nikula
@ 2024-09-10 18:11   ` Chrisanthus, Anitha
  2024-09-13 11:46     ` Jani Nikula
  0 siblings, 1 reply; 35+ messages in thread
From: Chrisanthus, Anitha @ 2024-09-10 18:11 UTC (permalink / raw)
  To: Nikula, Jani, dri-devel@lists.freedesktop.org
  Cc: intel-gfx@lists.freedesktop.org, intel-xe@lists.freedesktop.org,
	Nathan Chancellor, Edmund Dea

Thanks for the patch.

Acked-by: Anitha Chrisanthus <anitha.chrisanthus@intel.com>

Anitha
> -----Original Message-----
> From: Nikula, Jani <jani.nikula@intel.com>
> Sent: Tuesday, September 10, 2024 3:04 AM
> To: dri-devel@lists.freedesktop.org
> Cc: intel-gfx@lists.freedesktop.org; intel-xe@lists.freedesktop.org; Nikula, Jani
> <jani.nikula@intel.com>; Nathan Chancellor <nathan@kernel.org>; Chrisanthus,
> Anitha <anitha.chrisanthus@intel.com>; Edmund Dea
> <edmund.j.dea@intel.com>
> Subject: [PATCH 3/8] drm/kmb: annotate
> set_test_mode_src_osc_freq_target_{low,hi}_bits() with __maybe_unused
> 
> Building with clang and and W=1 leads to warning about unused
> set_test_mode_src_osc_freq_target_low_bits() and
> set_test_mode_src_osc_freq_target_hi_bits(). 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: Anitha Chrisanthus <anitha.chrisanthus@intel.com>
> Cc: Edmund Dea <edmund.j.dea@intel.com>
> Cc: Nathan Chancellor <nathan@kernel.org>
> ---
>  drivers/gpu/drm/kmb/kmb_dsi.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/gpu/drm/kmb/kmb_dsi.c b/drivers/gpu/drm/kmb/kmb_dsi.c
> index cf7cf0b07541..faf38ca9e44c 100644
> --- a/drivers/gpu/drm/kmb/kmb_dsi.c
> +++ b/drivers/gpu/drm/kmb/kmb_dsi.c
> @@ -818,7 +818,7 @@ static void test_mode_send(struct kmb_dsi *kmb_dsi,
> u32 dphy_no,
>  	}
>  }
> 
> -static inline void
> +static inline __maybe_unused void
>  	set_test_mode_src_osc_freq_target_low_bits(struct kmb_dsi *kmb_dsi,
>  						   u32 dphy_no,
>  						   u32 freq)
> @@ -830,7 +830,7 @@ static inline void
>  		       (freq & 0x7f));
>  }
> 
> -static inline void
> +static inline __maybe_unused void
>  	set_test_mode_src_osc_freq_target_hi_bits(struct kmb_dsi *kmb_dsi,
>  						  u32 dphy_no,
>  						  u32 freq)
> --
> 2.39.2


^ permalink raw reply	[flat|nested] 35+ messages in thread

* Re: [PATCH 4/8] drm/bridge: ti-sn65dsi86: annotate ti_sn_pwm_pin_{request, release} with __maybe_unused
  2024-09-10 10:03 ` [PATCH 4/8] drm/bridge: ti-sn65dsi86: annotate ti_sn_pwm_pin_{request, release} " Jani Nikula
@ 2024-09-10 22:57   ` Doug Anderson
  2024-09-11  8:01     ` Jani Nikula
  0 siblings, 1 reply; 35+ messages in thread
From: Doug Anderson @ 2024-09-10 22:57 UTC (permalink / raw)
  To: Jani Nikula
  Cc: dri-devel, intel-gfx, intel-xe, Nathan Chancellor, Andrzej Hajda,
	Neil Armstrong, Robert Foss, Laurent Pinchart, Jonas Karlman,
	Jernej Skrabec

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

^ permalink raw reply	[flat|nested] 35+ messages in thread

* Re: [PATCH 4/8] drm/bridge: ti-sn65dsi86: annotate ti_sn_pwm_pin_{request, release} with __maybe_unused
  2024-09-10 22:57   ` Doug Anderson
@ 2024-09-11  8:01     ` Jani Nikula
  2024-09-11 20:07       ` Doug Anderson
  0 siblings, 1 reply; 35+ messages in thread
From: Jani Nikula @ 2024-09-11  8:01 UTC (permalink / raw)
  To: Doug Anderson
  Cc: dri-devel, intel-gfx, intel-xe, Nathan Chancellor, Andrzej Hajda,
	Neil Armstrong, Robert Foss, Laurent Pinchart, Jonas Karlman,
	Jernej Skrabec

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.


-- 
Jani Nikula, Intel

^ permalink raw reply	[flat|nested] 35+ messages in thread

* Re: [PATCH 2/8] drm: renesas: rcar-du: annotate rcar_cmm_read() with __maybe_unused
  2024-09-10 13:36     ` Jani Nikula
@ 2024-09-11  9:51       ` Laurent Pinchart
  2024-09-11 10:21         ` Jani Nikula
  0 siblings, 1 reply; 35+ messages in thread
From: Laurent Pinchart @ 2024-09-11  9:51 UTC (permalink / raw)
  To: Jani Nikula
  Cc: Geert Uytterhoeven, dri-devel, intel-gfx, intel-xe,
	Nathan Chancellor, Kieran Bingham, linux-renesas-soc

On Tue, Sep 10, 2024 at 04:36:01PM +0300, Jani Nikula wrote:
> On Tue, 10 Sep 2024, Geert Uytterhoeven <geert@linux-m68k.org> wrote:
> > Hi Jani,
> >
> > On Tue, Sep 10, 2024 at 12:06 PM Jani Nikula <jani.nikula@intel.com> wrote:
> >> Building with clang and and W=1 leads to warning about unused
> >> rcar_cmm_read(). Fix by annotating it 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>
> >
> > Thanks for your patch!
> >
> >> --- a/drivers/gpu/drm/renesas/rcar-du/rcar_cmm.c
> >> +++ b/drivers/gpu/drm/renesas/rcar-du/rcar_cmm.c
> >> @@ -32,7 +32,7 @@ struct rcar_cmm {
> >>         } lut;
> >>  };
> >>
> >> -static inline int rcar_cmm_read(struct rcar_cmm *rcmm, u32 reg)
> >> +static inline __maybe_unused int rcar_cmm_read(struct rcar_cmm *rcmm, u32 reg)
> >>  {
> >>         return ioread32(rcmm->base + reg);
> >>  }
> >
> > This function was never used. Why not remove it instead?
> 
> Can do if that's what the maintainers desire. It's just that sometimes
> it's better to have the implementation reviewed and ready waiting for
> the users than requiring the first user to add the implementation. I
> opted for __maybe_unused across the series.

Jiapeng Chong has sent a patch to drop the function, and I've reviewed
it. See https://lore.kernel.org/r/20240619075436.86407-1-jiapeng.chong@linux.alibaba.com

I've sent a pull request for v6.12 but it hasn't been processed in time
:-( See https://lore.kernel.org/r/20240822234445.GA23541@pendragon.ideasonboard.com

-- 
Regards,

Laurent Pinchart

^ permalink raw reply	[flat|nested] 35+ messages in thread

* Re: [PATCH 2/8] drm: renesas: rcar-du: annotate rcar_cmm_read() with __maybe_unused
  2024-09-11  9:51       ` Laurent Pinchart
@ 2024-09-11 10:21         ` Jani Nikula
  0 siblings, 0 replies; 35+ messages in thread
From: Jani Nikula @ 2024-09-11 10:21 UTC (permalink / raw)
  To: Laurent Pinchart
  Cc: Geert Uytterhoeven, dri-devel, intel-gfx, intel-xe,
	Nathan Chancellor, Kieran Bingham, linux-renesas-soc

On Wed, 11 Sep 2024, Laurent Pinchart <laurent.pinchart@ideasonboard.com> wrote:
> Jiapeng Chong has sent a patch to drop the function, and I've reviewed
> it. See https://lore.kernel.org/r/20240619075436.86407-1-jiapeng.chong@linux.alibaba.com

Even better, thanks!

BR,
Jani.

-- 
Jani Nikula, Intel

^ permalink raw reply	[flat|nested] 35+ messages in thread

* Re: [PATCH 7/8] drm/msmi: annotate pll_cmp_to_fdata() with __maybe_unused
  2024-09-10 15:54     ` Marc Gonzalez
@ 2024-09-11 10:23       ` Jani Nikula
  2024-09-12 10:56         ` Marc Gonzalez
  2024-09-21 21:16         ` Dmitry Baryshkov
  0 siblings, 2 replies; 35+ messages in thread
From: Jani Nikula @ 2024-09-11 10:23 UTC (permalink / raw)
  To: Marc Gonzalez, Dmitry Baryshkov, Arnaud Vrac
  Cc: dri-devel, intel-gfx, intel-xe, Nathan Chancellor, Rob Clark,
	Abhinav Kumar, Sean Paul, Marijn Suijten, linux-arm-msm

On Tue, 10 Sep 2024, Marc Gonzalez <mgonzalez@freebox.fr> wrote:
> On 10/09/2024 16:51, Dmitry Baryshkov wrote:
>
>> On Tue, Sep 10, 2024 at 01:03:43PM GMT, Jani Nikula wrote:
>>
>>> Building with clang and and W=1 leads to warning about unused
>>> pll_cmp_to_fdata(). Fix by annotating it 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>
>> 
>> I think this function can be dropped. Marc, your call, as an author of
>> the patch?
>
> ( Why is the patch prefixed "drm/msmi", is "msmi" a typo? )

Whoops, a typo.

>
> -> For the record, Arnaud is the driver's author.
>
> pll_cmp_to_fdata() was used in hdmi_8998_pll_recalc_rate()
> in a commented code block which was later removed.
>
> Thus, yes, it is safe to completely delete the unused function.
> I'm surprised gcc didn't catch that...

Thanks, I'll change this to drop the function.

GCC doesn't catch unused static inlines, while Clang does.

BR,
Jani.


>
> Regards
>
>
>>> ---
>>>  drivers/gpu/drm/msm/hdmi/hdmi_phy_8998.c | 2 +-
>>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>>
>>> diff --git a/drivers/gpu/drm/msm/hdmi/hdmi_phy_8998.c b/drivers/gpu/drm/msm/hdmi/hdmi_phy_8998.c
>>> index 0e3a2b16a2ce..c0bf1f35539e 100644
>>> --- a/drivers/gpu/drm/msm/hdmi/hdmi_phy_8998.c
>>> +++ b/drivers/gpu/drm/msm/hdmi/hdmi_phy_8998.c
>>> @@ -153,7 +153,7 @@ static inline u32 pll_get_pll_cmp(u64 fdata, unsigned long ref_clk)
>>>  	return dividend - 1;
>>>  }
>>>  
>>> -static inline u64 pll_cmp_to_fdata(u32 pll_cmp, unsigned long ref_clk)
>>> +static inline __maybe_unused u64 pll_cmp_to_fdata(u32 pll_cmp, unsigned long ref_clk)
>>>  {
>>>  	u64 fdata = ((u64)pll_cmp) * ref_clk * 10;
>>>  
>>> -- 
>>> 2.39.2
>
>

-- 
Jani Nikula, Intel

^ permalink raw reply	[flat|nested] 35+ messages in thread

* Re: [PATCH 0/8] drm: fix and enable warnings on unused static inlines
  2024-09-10 10:03 [PATCH 0/8] drm: fix and enable warnings on unused static inlines Jani Nikula
                   ` (7 preceding siblings ...)
  2024-09-10 10:03 ` [PATCH 8/8] drm: enable warnings on unused static inlines Jani Nikula
@ 2024-09-11 17:46 ` Nathan Chancellor
  8 siblings, 0 replies; 35+ messages in thread
From: Nathan Chancellor @ 2024-09-11 17:46 UTC (permalink / raw)
  To: Jani Nikula; +Cc: dri-devel, intel-gfx, intel-xe

On Tue, Sep 10, 2024 at 01:03:36PM +0300, Jani Nikula wrote:
> Follow-up to [1].
> 
> Annotate unused static inlines with __maybe_unused. In some cases it
> might be better to remove them, but it's really up to the maintainers
> what to do. Then enable the warning on default across subsystem.

I merged drm-misc-next into next-20240910 and applied this series on top
of the result and it looks like all of the instances are fixed.

Tested-by: Nathan Chancellor <nathan@kernel.org> # build

Cheers,
Nathan

^ permalink raw reply	[flat|nested] 35+ messages in thread

* Re: [PATCH 4/8] drm/bridge: ti-sn65dsi86: annotate ti_sn_pwm_pin_{request, release} with __maybe_unused
  2024-09-11  8:01     ` Jani Nikula
@ 2024-09-11 20:07       ` Doug Anderson
  0 siblings, 0 replies; 35+ messages in thread
From: Doug Anderson @ 2024-09-11 20:07 UTC (permalink / raw)
  To: Jani Nikula
  Cc: dri-devel, intel-gfx, intel-xe, Nathan Chancellor, Andrzej Hajda,
	Neil Armstrong, Robert Foss, Laurent Pinchart, Jonas Karlman,
	Jernej Skrabec

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

^ permalink raw reply	[flat|nested] 35+ messages in thread

* Re: [PATCH 7/8] drm/msmi: annotate pll_cmp_to_fdata() with __maybe_unused
  2024-09-11 10:23       ` Jani Nikula
@ 2024-09-12 10:56         ` Marc Gonzalez
  2024-09-12 11:15           ` Jani Nikula
  2024-09-21 21:16         ` Dmitry Baryshkov
  1 sibling, 1 reply; 35+ messages in thread
From: Marc Gonzalez @ 2024-09-12 10:56 UTC (permalink / raw)
  To: Jani Nikula, Dmitry Baryshkov, Arnaud Vrac
  Cc: dri-devel, intel-gfx, intel-xe, Nathan Chancellor, Rob Clark,
	Abhinav Kumar, Sean Paul, Marijn Suijten, linux-arm-msm

On 11/09/2024 12:23, Jani Nikula wrote:
> On Tue, 10 Sep 2024, Marc Gonzalez <mgonzalez@freebox.fr> wrote:
>> On 10/09/2024 16:51, Dmitry Baryshkov wrote:
>>> On Tue, Sep 10, 2024 at 01:03:43PM GMT, Jani Nikula wrote:
>>>
>>>> Building with clang and and W=1 leads to warning about unused
>>>> pll_cmp_to_fdata(). Fix by annotating it 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>
>>>
>>> I think this function can be dropped. Marc, your call, as an author of
>>> the patch?
>>
>> ( Why is the patch prefixed "drm/msmi", is "msmi" a typo? )
> 
> Whoops, a typo.
> 
>>> For the record, Arnaud is the driver's author.
>>
>> pll_cmp_to_fdata() was used in hdmi_8998_pll_recalc_rate()
>> in a commented code block which was later removed.
>>
>> Thus, yes, it is safe to completely delete the unused function.
>> I'm surprised gcc didn't catch that...
> 
> Thanks, I'll change this to drop the function.
> 
> GCC doesn't catch unused static inlines, while Clang does.

It makes no sense to me that adding "inline" would prevent
GCC from diagnosing the issue... GCC should simply ignore
the "inline" keyword when definition is not in a header file
(maybe they don't store "origin").

Regards


^ permalink raw reply	[flat|nested] 35+ messages in thread

* Re: [PATCH 7/8] drm/msmi: annotate pll_cmp_to_fdata() with __maybe_unused
  2024-09-12 10:56         ` Marc Gonzalez
@ 2024-09-12 11:15           ` Jani Nikula
  2024-09-12 12:14             ` Marc Gonzalez
  0 siblings, 1 reply; 35+ messages in thread
From: Jani Nikula @ 2024-09-12 11:15 UTC (permalink / raw)
  To: Marc Gonzalez, Dmitry Baryshkov, Arnaud Vrac
  Cc: dri-devel, intel-gfx, intel-xe, Nathan Chancellor, Rob Clark,
	Abhinav Kumar, Sean Paul, Marijn Suijten, linux-arm-msm

On Thu, 12 Sep 2024, Marc Gonzalez <mgonzalez@freebox.fr> wrote:
> On 11/09/2024 12:23, Jani Nikula wrote:
>> On Tue, 10 Sep 2024, Marc Gonzalez <mgonzalez@freebox.fr> wrote:
>>> On 10/09/2024 16:51, Dmitry Baryshkov wrote:
>>>> On Tue, Sep 10, 2024 at 01:03:43PM GMT, Jani Nikula wrote:
>>>>> See also commit 6863f5643dd7 ("kbuild: allow Clang to find unused static
>>>>> inline functions for W=1 build").

[snip]

>> GCC doesn't catch unused static inlines, while Clang does.
>
> It makes no sense to me that adding "inline" would prevent
> GCC from diagnosing the issue... GCC should simply ignore
> the "inline" keyword when definition is not in a header file
> (maybe they don't store "origin").

Please just read the commit message for the commit I reference above for
details. There's not much more I could say about it.

BR,
Jani.

-- 
Jani Nikula, Intel

^ permalink raw reply	[flat|nested] 35+ messages in thread

* Re: [PATCH 7/8] drm/msmi: annotate pll_cmp_to_fdata() with __maybe_unused
  2024-09-12 11:15           ` Jani Nikula
@ 2024-09-12 12:14             ` Marc Gonzalez
  2024-09-12 12:28               ` Dmitry Baryshkov
  0 siblings, 1 reply; 35+ messages in thread
From: Marc Gonzalez @ 2024-09-12 12:14 UTC (permalink / raw)
  To: Jani Nikula, Dmitry Baryshkov, Arnaud Vrac
  Cc: dri-devel, intel-gfx, intel-xe, Nathan Chancellor, Rob Clark,
	Abhinav Kumar, Sean Paul, Marijn Suijten, linux-arm-msm

On 12/09/2024 13:15, Jani Nikula wrote:
> On Thu, 12 Sep 2024, Marc Gonzalez wrote:
>> On 11/09/2024 12:23, Jani Nikula wrote:
>>> On Tue, 10 Sep 2024, Marc Gonzalez wrote:
>>>> On 10/09/2024 16:51, Dmitry Baryshkov wrote:
>>>>> On Tue, Sep 10, 2024 at 01:03:43PM GMT, Jani Nikula wrote:
>>>>>> See also commit 6863f5643dd7 ("kbuild: allow Clang to find unused static
>>>>>> inline functions for W=1 build").
> 
> [snip]
> 
>>> GCC doesn't catch unused static inlines, while Clang does.
>>
>> It makes no sense to me that adding "inline" would prevent
>> GCC from diagnosing the issue... GCC should simply ignore
>> the "inline" keyword when definition is not in a header file
>> (maybe they don't store "origin").
> 
> Please just read the commit message for the commit I reference above for
> details. There's not much more I could say about it.

OK, I read 6863f5643dd7.

My remark still stands.

GCC's decision to not warn for unused static inline functions
in source files (not headers) is questionable at best.

(For the record, I think clang is the devil's spawn.)

Regards


^ permalink raw reply	[flat|nested] 35+ messages in thread

* Re: [PATCH 7/8] drm/msmi: annotate pll_cmp_to_fdata() with __maybe_unused
  2024-09-12 12:14             ` Marc Gonzalez
@ 2024-09-12 12:28               ` Dmitry Baryshkov
  2024-09-12 12:50                 ` Marc Gonzalez
  0 siblings, 1 reply; 35+ messages in thread
From: Dmitry Baryshkov @ 2024-09-12 12:28 UTC (permalink / raw)
  To: Marc Gonzalez
  Cc: Jani Nikula, Arnaud Vrac, dri-devel, intel-gfx, intel-xe,
	Nathan Chancellor, Rob Clark, Abhinav Kumar, Sean Paul,
	Marijn Suijten, linux-arm-msm

On Thu, Sep 12, 2024 at 02:14:10PM GMT, Marc Gonzalez wrote:
> On 12/09/2024 13:15, Jani Nikula wrote:
> > On Thu, 12 Sep 2024, Marc Gonzalez wrote:
> >> On 11/09/2024 12:23, Jani Nikula wrote:
> >>> On Tue, 10 Sep 2024, Marc Gonzalez wrote:
> >>>> On 10/09/2024 16:51, Dmitry Baryshkov wrote:
> >>>>> On Tue, Sep 10, 2024 at 01:03:43PM GMT, Jani Nikula wrote:
> >>>>>> See also commit 6863f5643dd7 ("kbuild: allow Clang to find unused static
> >>>>>> inline functions for W=1 build").
> > 
> > [snip]
> > 
> >>> GCC doesn't catch unused static inlines, while Clang does.
> >>
> >> It makes no sense to me that adding "inline" would prevent
> >> GCC from diagnosing the issue... GCC should simply ignore
> >> the "inline" keyword when definition is not in a header file
> >> (maybe they don't store "origin").
> > 
> > Please just read the commit message for the commit I reference above for
> > details. There's not much more I could say about it.
> 
> OK, I read 6863f5643dd7.
> 
> My remark still stands.
> 
> GCC's decision to not warn for unused static inline functions
> in source files (not headers) is questionable at best.

What's the difference between source file and a header after the CPP
run?

> (For the record, I think clang is the devil's spawn.)
> 
> Regards
> 

-- 
With best wishes
Dmitry

^ permalink raw reply	[flat|nested] 35+ messages in thread

* Re: [PATCH 7/8] drm/msmi: annotate pll_cmp_to_fdata() with __maybe_unused
  2024-09-12 12:28               ` Dmitry Baryshkov
@ 2024-09-12 12:50                 ` Marc Gonzalez
  2024-09-12 13:05                   ` Dmitry Baryshkov
  0 siblings, 1 reply; 35+ messages in thread
From: Marc Gonzalez @ 2024-09-12 12:50 UTC (permalink / raw)
  To: Dmitry Baryshkov
  Cc: Jani Nikula, Arnaud Vrac, dri-devel, intel-gfx, intel-xe,
	Nathan Chancellor, Rob Clark, Abhinav Kumar, Sean Paul,
	Marijn Suijten, linux-arm-msm

On 12/09/2024 14:28, Dmitry Baryshkov wrote:
> On Thu, Sep 12, 2024 at 02:14:10PM GMT, Marc Gonzalez wrote:
>> On 12/09/2024 13:15, Jani Nikula wrote:
>>> On Thu, 12 Sep 2024, Marc Gonzalez wrote:
>>>> On 11/09/2024 12:23, Jani Nikula wrote:
>>>>> On Tue, 10 Sep 2024, Marc Gonzalez wrote:
>>>>>> On 10/09/2024 16:51, Dmitry Baryshkov wrote:
>>>>>>> On Tue, Sep 10, 2024 at 01:03:43PM GMT, Jani Nikula wrote:
>>>>>>>> See also commit 6863f5643dd7 ("kbuild: allow Clang to find unused static
>>>>>>>> inline functions for W=1 build").
>>>
>>> [snip]
>>>
>>>>> GCC doesn't catch unused static inlines, while Clang does.
>>>>
>>>> It makes no sense to me that adding "inline" would prevent
>>>> GCC from diagnosing the issue... GCC should simply ignore
>>>> the "inline" keyword when definition is not in a header file
>>>> (maybe they don't store "origin").
>>>
>>> Please just read the commit message for the commit I reference above for
>>> details. There's not much more I could say about it.
>>
>> OK, I read 6863f5643dd7.
>>
>> My remark still stands.
>>
>> GCC's decision to not warn for unused static inline functions
>> in source files (not headers) is questionable at best.
> 
> What's the difference between source file and a header after the CPP
> run?

That question is moot, since the source file / header file
convention exists only _before_ the preprocessor runs.

If you meant to ask
"How is the implementation supposed to track the origin",
then I would hand wave and say "internal annotations".


^ permalink raw reply	[flat|nested] 35+ messages in thread

* Re: [PATCH 7/8] drm/msmi: annotate pll_cmp_to_fdata() with __maybe_unused
  2024-09-12 12:50                 ` Marc Gonzalez
@ 2024-09-12 13:05                   ` Dmitry Baryshkov
  2024-09-12 13:10                     ` Jani Nikula
  0 siblings, 1 reply; 35+ messages in thread
From: Dmitry Baryshkov @ 2024-09-12 13:05 UTC (permalink / raw)
  To: Marc Gonzalez
  Cc: Jani Nikula, Arnaud Vrac, dri-devel, intel-gfx, intel-xe,
	Nathan Chancellor, Rob Clark, Abhinav Kumar, Sean Paul,
	Marijn Suijten, linux-arm-msm

On Thu, Sep 12, 2024 at 02:50:04PM GMT, Marc Gonzalez wrote:
> On 12/09/2024 14:28, Dmitry Baryshkov wrote:
> > On Thu, Sep 12, 2024 at 02:14:10PM GMT, Marc Gonzalez wrote:
> >> On 12/09/2024 13:15, Jani Nikula wrote:
> >>> On Thu, 12 Sep 2024, Marc Gonzalez wrote:
> >>>> On 11/09/2024 12:23, Jani Nikula wrote:
> >>>>> On Tue, 10 Sep 2024, Marc Gonzalez wrote:
> >>>>>> On 10/09/2024 16:51, Dmitry Baryshkov wrote:
> >>>>>>> On Tue, Sep 10, 2024 at 01:03:43PM GMT, Jani Nikula wrote:
> >>>>>>>> See also commit 6863f5643dd7 ("kbuild: allow Clang to find unused static
> >>>>>>>> inline functions for W=1 build").
> >>>
> >>> [snip]
> >>>
> >>>>> GCC doesn't catch unused static inlines, while Clang does.
> >>>>
> >>>> It makes no sense to me that adding "inline" would prevent
> >>>> GCC from diagnosing the issue... GCC should simply ignore
> >>>> the "inline" keyword when definition is not in a header file
> >>>> (maybe they don't store "origin").
> >>>
> >>> Please just read the commit message for the commit I reference above for
> >>> details. There's not much more I could say about it.
> >>
> >> OK, I read 6863f5643dd7.
> >>
> >> My remark still stands.
> >>
> >> GCC's decision to not warn for unused static inline functions
> >> in source files (not headers) is questionable at best.
> > 
> > What's the difference between source file and a header after the CPP
> > run?
> 
> That question is moot, since the source file / header file
> convention exists only _before_ the preprocessor runs.
> 
> If you meant to ask
> "How is the implementation supposed to track the origin",
> then I would hand wave and say "internal annotations".

No, I asked what I meant. #include doesn't have any semantics. You can
#include "source.c" in the same way. So asking the compiler to make a
difference between source file and the header isn't going to work (Note,
gcc has some notion of system header files and I think a pragma that
changes the behaviour a bit, but we are not talking about such cases,
are we?).

-- 
With best wishes
Dmitry

^ permalink raw reply	[flat|nested] 35+ messages in thread

* Re: [PATCH 7/8] drm/msmi: annotate pll_cmp_to_fdata() with __maybe_unused
  2024-09-12 13:05                   ` Dmitry Baryshkov
@ 2024-09-12 13:10                     ` Jani Nikula
  0 siblings, 0 replies; 35+ messages in thread
From: Jani Nikula @ 2024-09-12 13:10 UTC (permalink / raw)
  To: Dmitry Baryshkov, Marc Gonzalez
  Cc: Arnaud Vrac, dri-devel, intel-gfx, intel-xe, Nathan Chancellor,
	Rob Clark, Abhinav Kumar, Sean Paul, Marijn Suijten,
	linux-arm-msm

On Thu, 12 Sep 2024, Dmitry Baryshkov <dmitry.baryshkov@linaro.org> wrote:
> On Thu, Sep 12, 2024 at 02:50:04PM GMT, Marc Gonzalez wrote:
>> On 12/09/2024 14:28, Dmitry Baryshkov wrote:
>> > On Thu, Sep 12, 2024 at 02:14:10PM GMT, Marc Gonzalez wrote:
>> >> On 12/09/2024 13:15, Jani Nikula wrote:
>> >>> On Thu, 12 Sep 2024, Marc Gonzalez wrote:
>> >>>> On 11/09/2024 12:23, Jani Nikula wrote:
>> >>>>> On Tue, 10 Sep 2024, Marc Gonzalez wrote:
>> >>>>>> On 10/09/2024 16:51, Dmitry Baryshkov wrote:
>> >>>>>>> On Tue, Sep 10, 2024 at 01:03:43PM GMT, Jani Nikula wrote:
>> >>>>>>>> See also commit 6863f5643dd7 ("kbuild: allow Clang to find unused static
>> >>>>>>>> inline functions for W=1 build").
>> >>>
>> >>> [snip]
>> >>>
>> >>>>> GCC doesn't catch unused static inlines, while Clang does.
>> >>>>
>> >>>> It makes no sense to me that adding "inline" would prevent
>> >>>> GCC from diagnosing the issue... GCC should simply ignore
>> >>>> the "inline" keyword when definition is not in a header file
>> >>>> (maybe they don't store "origin").
>> >>>
>> >>> Please just read the commit message for the commit I reference above for
>> >>> details. There's not much more I could say about it.
>> >>
>> >> OK, I read 6863f5643dd7.
>> >>
>> >> My remark still stands.
>> >>
>> >> GCC's decision to not warn for unused static inline functions
>> >> in source files (not headers) is questionable at best.
>> > 
>> > What's the difference between source file and a header after the CPP
>> > run?
>> 
>> That question is moot, since the source file / header file
>> convention exists only _before_ the preprocessor runs.
>> 
>> If you meant to ask
>> "How is the implementation supposed to track the origin",
>> then I would hand wave and say "internal annotations".
>
> No, I asked what I meant. #include doesn't have any semantics. You can
> #include "source.c" in the same way. So asking the compiler to make a
> difference between source file and the header isn't going to work (Note,
> gcc has some notion of system header files and I think a pragma that
> changes the behaviour a bit, but we are not talking about such cases,
> are we?).

Just saying, this sub-thread might be more fruitful on some GCC bug or
list.

BR,
Jani.

-- 
Jani Nikula, Intel

^ permalink raw reply	[flat|nested] 35+ messages in thread

* RE: [PATCH 3/8] drm/kmb: annotate set_test_mode_src_osc_freq_target_{low,hi}_bits() with __maybe_unused
  2024-09-10 18:11   ` [PATCH 3/8] drm/kmb: annotate set_test_mode_src_osc_freq_target_{low,hi}_bits() " Chrisanthus, Anitha
@ 2024-09-13 11:46     ` Jani Nikula
  0 siblings, 0 replies; 35+ messages in thread
From: Jani Nikula @ 2024-09-13 11:46 UTC (permalink / raw)
  To: Chrisanthus, Anitha, dri-devel@lists.freedesktop.org
  Cc: intel-gfx@lists.freedesktop.org, intel-xe@lists.freedesktop.org,
	Nathan Chancellor, Edmund Dea

On Tue, 10 Sep 2024, "Chrisanthus, Anitha" <anitha.chrisanthus@intel.com> wrote:
> Thanks for the patch.
>
> Acked-by: Anitha Chrisanthus <anitha.chrisanthus@intel.com>

Thanks, pushed to drm-misc-next.

BR,
Jani.

-- 
Jani Nikula, Intel

^ permalink raw reply	[flat|nested] 35+ messages in thread

* Re: [PATCH 5/8] drm/imagination: annotate pvr_fw_version_packed() with __maybe_unused
  2024-09-10 10:40   ` Matt Coster
@ 2024-09-13 11:47     ` Jani Nikula
  0 siblings, 0 replies; 35+ messages in thread
From: Jani Nikula @ 2024-09-13 11:47 UTC (permalink / raw)
  To: Matt Coster, dri-devel@lists.freedesktop.org
  Cc: intel-gfx@lists.freedesktop.org, intel-xe@lists.freedesktop.org,
	Nathan Chancellor, Frank Binns

On Tue, 10 Sep 2024, Matt Coster <Matt.Coster@imgtec.com> wrote:
> On 10/09/2024 11:03, Jani Nikula wrote:
>> Building with clang and and W=1 leads to warning about unused
>> pvr_fw_version_packed(). Fix by annotating it 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>
>
> I've been meaning to do something about this for a while, thanks!
>
> Reviewed-by: Matt Coster <matt.coster@imgtec.com>

Thanks, pushed to drm-misc-next.

BR,
Jani.

-- 
Jani Nikula, Intel

^ permalink raw reply	[flat|nested] 35+ messages in thread

* Re: [PATCH 6/8] drm/meson: dw-hdmi: annotate dw_hdmi_dwc_write_bits() with __maybe_unused
  2024-09-10 10:03 ` [PATCH 6/8] drm/meson: dw-hdmi: annotate dw_hdmi_dwc_write_bits() " Jani Nikula
@ 2024-09-15 19:35   ` Martin Blumenstingl
  2024-09-16  7:43     ` Jani Nikula
  0 siblings, 1 reply; 35+ messages in thread
From: Martin Blumenstingl @ 2024-09-15 19:35 UTC (permalink / raw)
  To: Jani Nikula
  Cc: dri-devel, intel-gfx, intel-xe, Nathan Chancellor, Neil Armstrong,
	linux-amlogic

Hi Jani,

On Tue, Sep 10, 2024 at 12:08 PM Jani Nikula <jani.nikula@intel.com> wrote:
>
> Building with clang and and W=1 leads to warning about unused
> dw_hdmi_dwc_write_bits(). Fix by annotating it 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>
I prefer dropping this function for which there's a patch already: [0]


[0] https://lore.kernel.org/linux-amlogic/20240908-regmap-config-const-v1-1-28f349004811@linaro.org/

^ permalink raw reply	[flat|nested] 35+ messages in thread

* Re: [PATCH 6/8] drm/meson: dw-hdmi: annotate dw_hdmi_dwc_write_bits() with __maybe_unused
  2024-09-15 19:35   ` Martin Blumenstingl
@ 2024-09-16  7:43     ` Jani Nikula
  0 siblings, 0 replies; 35+ messages in thread
From: Jani Nikula @ 2024-09-16  7:43 UTC (permalink / raw)
  To: Martin Blumenstingl
  Cc: dri-devel, intel-gfx, intel-xe, Nathan Chancellor, Neil Armstrong,
	linux-amlogic

On Sun, 15 Sep 2024, Martin Blumenstingl <martin.blumenstingl@googlemail.com> wrote:
> Hi Jani,
>
> On Tue, Sep 10, 2024 at 12:08 PM Jani Nikula <jani.nikula@intel.com> wrote:
>>
>> Building with clang and and W=1 leads to warning about unused
>> dw_hdmi_dwc_write_bits(). Fix by annotating it 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>
> I prefer dropping this function for which there's a patch already: [0]

Even better, thanks!

BR,
Jani.

>
>
> [0] https://lore.kernel.org/linux-amlogic/20240908-regmap-config-const-v1-1-28f349004811@linaro.org/

-- 
Jani Nikula, Intel

^ permalink raw reply	[flat|nested] 35+ messages in thread

* Re: [PATCH 7/8] drm/msmi: annotate pll_cmp_to_fdata() with __maybe_unused
  2024-09-11 10:23       ` Jani Nikula
  2024-09-12 10:56         ` Marc Gonzalez
@ 2024-09-21 21:16         ` Dmitry Baryshkov
  2024-09-23  6:38           ` Jani Nikula
  1 sibling, 1 reply; 35+ messages in thread
From: Dmitry Baryshkov @ 2024-09-21 21:16 UTC (permalink / raw)
  To: Jani Nikula
  Cc: Marc Gonzalez, Arnaud Vrac, dri-devel, intel-gfx, intel-xe,
	Nathan Chancellor, Rob Clark, Abhinav Kumar, Sean Paul,
	Marijn Suijten, linux-arm-msm

On Wed, Sep 11, 2024 at 01:23:23PM GMT, Jani Nikula wrote:
> On Tue, 10 Sep 2024, Marc Gonzalez <mgonzalez@freebox.fr> wrote:
> > On 10/09/2024 16:51, Dmitry Baryshkov wrote:
> >
> >> On Tue, Sep 10, 2024 at 01:03:43PM GMT, Jani Nikula wrote:
> >>
> >>> Building with clang and and W=1 leads to warning about unused
> >>> pll_cmp_to_fdata(). Fix by annotating it 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>
> >> 
> >> I think this function can be dropped. Marc, your call, as an author of
> >> the patch?
> >
> > ( Why is the patch prefixed "drm/msmi", is "msmi" a typo? )
> 
> Whoops, a typo.
> 
> >
> > -> For the record, Arnaud is the driver's author.
> >
> > pll_cmp_to_fdata() was used in hdmi_8998_pll_recalc_rate()
> > in a commented code block which was later removed.
> >
> > Thus, yes, it is safe to completely delete the unused function.
> > I'm surprised gcc didn't catch that...
> 
> Thanks, I'll change this to drop the function.

Seeing no updated revisions here, I've posted a patch that drops the
offending function. If I missed an update, please exuse me.

> 
> GCC doesn't catch unused static inlines, while Clang does.
> 
> BR,
> Jani.
> 
> 
> >
> > Regards
> >
> >
> >>> ---
> >>>  drivers/gpu/drm/msm/hdmi/hdmi_phy_8998.c | 2 +-
> >>>  1 file changed, 1 insertion(+), 1 deletion(-)
> >>>
> >>> diff --git a/drivers/gpu/drm/msm/hdmi/hdmi_phy_8998.c b/drivers/gpu/drm/msm/hdmi/hdmi_phy_8998.c
> >>> index 0e3a2b16a2ce..c0bf1f35539e 100644
> >>> --- a/drivers/gpu/drm/msm/hdmi/hdmi_phy_8998.c
> >>> +++ b/drivers/gpu/drm/msm/hdmi/hdmi_phy_8998.c
> >>> @@ -153,7 +153,7 @@ static inline u32 pll_get_pll_cmp(u64 fdata, unsigned long ref_clk)
> >>>  	return dividend - 1;
> >>>  }
> >>>  
> >>> -static inline u64 pll_cmp_to_fdata(u32 pll_cmp, unsigned long ref_clk)
> >>> +static inline __maybe_unused u64 pll_cmp_to_fdata(u32 pll_cmp, unsigned long ref_clk)
> >>>  {
> >>>  	u64 fdata = ((u64)pll_cmp) * ref_clk * 10;
> >>>  
> >>> -- 
> >>> 2.39.2
> >
> >
> 
> -- 
> Jani Nikula, Intel

-- 
With best wishes
Dmitry

^ permalink raw reply	[flat|nested] 35+ messages in thread

* Re: [PATCH 7/8] drm/msmi: annotate pll_cmp_to_fdata() with __maybe_unused
  2024-09-21 21:16         ` Dmitry Baryshkov
@ 2024-09-23  6:38           ` Jani Nikula
  0 siblings, 0 replies; 35+ messages in thread
From: Jani Nikula @ 2024-09-23  6:38 UTC (permalink / raw)
  To: Dmitry Baryshkov
  Cc: Marc Gonzalez, Arnaud Vrac, dri-devel, intel-gfx, intel-xe,
	Nathan Chancellor, Rob Clark, Abhinav Kumar, Sean Paul,
	Marijn Suijten, linux-arm-msm

On Sun, 22 Sep 2024, Dmitry Baryshkov <dmitry.baryshkov@linaro.org> wrote:
> On Wed, Sep 11, 2024 at 01:23:23PM GMT, Jani Nikula wrote:
>> Thanks, I'll change this to drop the function.
>
> Seeing no updated revisions here, I've posted a patch that drops the
> offending function. If I missed an update, please exuse me.

Thanks, I just didn't get around to it yet.

BR,
Jani.


-- 
Jani Nikula, Intel

^ permalink raw reply	[flat|nested] 35+ messages in thread

end of thread, other threads:[~2024-09-23  6:38 UTC | newest]

Thread overview: 35+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-09-10 10:03 [PATCH 0/8] drm: fix and enable warnings on unused static inlines Jani Nikula
2024-09-10 10:03 ` [PATCH 1/8] drm/bridge: dw-hdmi-i2s: annotate hdmi_read() with __maybe_unused Jani Nikula
2024-09-10 10:03 ` [PATCH 2/8] drm: renesas: rcar-du: annotate rcar_cmm_read() " Jani Nikula
2024-09-10 12:39   ` Geert Uytterhoeven
2024-09-10 13:36     ` Jani Nikula
2024-09-11  9:51       ` Laurent Pinchart
2024-09-11 10:21         ` Jani Nikula
2024-09-10 10:03 ` [PATCH 3/8] drm/kmb: annotate set_test_mode_src_osc_freq_target_{low, hi}_bits() " Jani Nikula
2024-09-10 18:11   ` [PATCH 3/8] drm/kmb: annotate set_test_mode_src_osc_freq_target_{low,hi}_bits() " Chrisanthus, Anitha
2024-09-13 11:46     ` Jani Nikula
2024-09-10 10:03 ` [PATCH 4/8] drm/bridge: ti-sn65dsi86: annotate ti_sn_pwm_pin_{request, release} " Jani Nikula
2024-09-10 22:57   ` Doug Anderson
2024-09-11  8:01     ` Jani Nikula
2024-09-11 20:07       ` Doug Anderson
2024-09-10 10:03 ` [PATCH 5/8] drm/imagination: annotate pvr_fw_version_packed() " Jani Nikula
2024-09-10 10:40   ` Matt Coster
2024-09-13 11:47     ` Jani Nikula
2024-09-10 10:03 ` [PATCH 6/8] drm/meson: dw-hdmi: annotate dw_hdmi_dwc_write_bits() " Jani Nikula
2024-09-15 19:35   ` Martin Blumenstingl
2024-09-16  7:43     ` Jani Nikula
2024-09-10 10:03 ` [PATCH 7/8] drm/msmi: annotate pll_cmp_to_fdata() " Jani Nikula
2024-09-10 14:51   ` Dmitry Baryshkov
2024-09-10 15:54     ` Marc Gonzalez
2024-09-11 10:23       ` Jani Nikula
2024-09-12 10:56         ` Marc Gonzalez
2024-09-12 11:15           ` Jani Nikula
2024-09-12 12:14             ` Marc Gonzalez
2024-09-12 12:28               ` Dmitry Baryshkov
2024-09-12 12:50                 ` Marc Gonzalez
2024-09-12 13:05                   ` Dmitry Baryshkov
2024-09-12 13:10                     ` Jani Nikula
2024-09-21 21:16         ` Dmitry Baryshkov
2024-09-23  6:38           ` Jani Nikula
2024-09-10 10:03 ` [PATCH 8/8] drm: enable warnings on unused static inlines Jani Nikula
2024-09-11 17:46 ` [PATCH 0/8] drm: fix and " Nathan Chancellor

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).