All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] soc: qcom: pd-mapper: mark qcom_pdm_domains as __maybe_unused
@ 2024-07-19 10:12 Arnd Bergmann
  2024-07-19 11:29 ` Dmitry Baryshkov
  2024-07-29  3:58 ` Bjorn Andersson
  0 siblings, 2 replies; 3+ messages in thread
From: Arnd Bergmann @ 2024-07-19 10:12 UTC (permalink / raw)
  To: Bjorn Andersson, Konrad Dybcio, Chris Lew, Dmitry Baryshkov
  Cc: Arnd Bergmann, linux-arm-msm, linux-kernel

From: Arnd Bergmann <arnd@arndb.de>

The qcom_pdm_domains[] array is used only when passing it into of_match_node()
but is not also referenced by MODULE_DEVICE_TABLE() or the platform driver
as a table. When CONFIG_OF is disabled, this causes a harmless build warning:

drivers/soc/qcom/qcom_pd_mapper.c:520:34: error: 'qcom_pdm_domains' defined but not used [-Werror=unused-const-variable=]

Avoid this by marking the variable as __maybe_unused. This also makes it
clear that anything referenced by it will be dropped by the compiler when
it is unused.

Fixes: 1ebcde047c54 ("soc: qcom: add pd-mapper implementation")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 drivers/soc/qcom/qcom_pd_mapper.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/soc/qcom/qcom_pd_mapper.c b/drivers/soc/qcom/qcom_pd_mapper.c
index a4c007080665..9afa09c3920e 100644
--- a/drivers/soc/qcom/qcom_pd_mapper.c
+++ b/drivers/soc/qcom/qcom_pd_mapper.c
@@ -517,7 +517,7 @@ static const struct qcom_pdm_domain_data *sm8550_domains[] = {
 	NULL,
 };
 
-static const struct of_device_id qcom_pdm_domains[] = {
+static const struct of_device_id qcom_pdm_domains[] __maybe_unused = {
 	{ .compatible = "qcom,apq8064", .data = NULL, },
 	{ .compatible = "qcom,apq8074", .data = NULL, },
 	{ .compatible = "qcom,apq8084", .data = NULL, },
-- 
2.39.2


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

* Re: [PATCH] soc: qcom: pd-mapper: mark qcom_pdm_domains as __maybe_unused
  2024-07-19 10:12 [PATCH] soc: qcom: pd-mapper: mark qcom_pdm_domains as __maybe_unused Arnd Bergmann
@ 2024-07-19 11:29 ` Dmitry Baryshkov
  2024-07-29  3:58 ` Bjorn Andersson
  1 sibling, 0 replies; 3+ messages in thread
From: Dmitry Baryshkov @ 2024-07-19 11:29 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: Bjorn Andersson, Konrad Dybcio, Chris Lew, Arnd Bergmann,
	linux-arm-msm, linux-kernel

On Fri, Jul 19, 2024 at 12:12:31PM GMT, Arnd Bergmann wrote:
> From: Arnd Bergmann <arnd@arndb.de>
> 
> The qcom_pdm_domains[] array is used only when passing it into of_match_node()
> but is not also referenced by MODULE_DEVICE_TABLE() or the platform driver
> as a table. When CONFIG_OF is disabled, this causes a harmless build warning:
> 
> drivers/soc/qcom/qcom_pd_mapper.c:520:34: error: 'qcom_pdm_domains' defined but not used [-Werror=unused-const-variable=]
> 
> Avoid this by marking the variable as __maybe_unused. This also makes it
> clear that anything referenced by it will be dropped by the compiler when
> it is unused.
> 
> Fixes: 1ebcde047c54 ("soc: qcom: add pd-mapper implementation")
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> ---
>  drivers/soc/qcom/qcom_pd_mapper.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 

Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>


-- 
With best wishes
Dmitry

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

* Re: [PATCH] soc: qcom: pd-mapper: mark qcom_pdm_domains as __maybe_unused
  2024-07-19 10:12 [PATCH] soc: qcom: pd-mapper: mark qcom_pdm_domains as __maybe_unused Arnd Bergmann
  2024-07-19 11:29 ` Dmitry Baryshkov
@ 2024-07-29  3:58 ` Bjorn Andersson
  1 sibling, 0 replies; 3+ messages in thread
From: Bjorn Andersson @ 2024-07-29  3:58 UTC (permalink / raw)
  To: Konrad Dybcio, Chris Lew, Dmitry Baryshkov, Arnd Bergmann
  Cc: Arnd Bergmann, linux-arm-msm, linux-kernel


On Fri, 19 Jul 2024 12:12:31 +0200, Arnd Bergmann wrote:
> The qcom_pdm_domains[] array is used only when passing it into of_match_node()
> but is not also referenced by MODULE_DEVICE_TABLE() or the platform driver
> as a table. When CONFIG_OF is disabled, this causes a harmless build warning:
> 
> drivers/soc/qcom/qcom_pd_mapper.c:520:34: error: 'qcom_pdm_domains' defined but not used [-Werror=unused-const-variable=]
> 
> Avoid this by marking the variable as __maybe_unused. This also makes it
> clear that anything referenced by it will be dropped by the compiler when
> it is unused.
> 
> [...]

Applied, thanks!

[1/1] soc: qcom: pd-mapper: mark qcom_pdm_domains as __maybe_unused
      commit: dbd6bd124e34f9f859271ed9ae2afc39f36c7e8c

Best regards,
-- 
Bjorn Andersson <andersson@kernel.org>

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

end of thread, other threads:[~2024-07-29  3:58 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-07-19 10:12 [PATCH] soc: qcom: pd-mapper: mark qcom_pdm_domains as __maybe_unused Arnd Bergmann
2024-07-19 11:29 ` Dmitry Baryshkov
2024-07-29  3:58 ` Bjorn Andersson

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.