From a3097907b3e09696f4e3dd75c77b0f6bc70d8cc2 Mon Sep 17 00:00:00 2001 From: Jon Hunter Date: Wed, 1 Oct 2025 11:27:27 +0100 Subject: [PATCH] platform: tegra: bwmgr: Fix debug macro build MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When NV_TEGRA264_BWMGR_DEBUG_MACRO_PRESENT is not defined the build fails and the following errors are seen ... drivers/platform/tegra/tegra-bpmp-bwmgr.c:101:12: error: ‘tegra_bpmp_bwmgr_devfreq_target’ defined but not used [-Werror=unused-function] 101 | static int tegra_bpmp_bwmgr_devfreq_target(struct device *dev, unsigned long *freq, u32 flags) | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ drivers/platform/tegra/tegra-bpmp-bwmgr.c:37:12: error: ‘tegra_bpmp_bwmgr_max_freq_notifier’ defined but not used [-Werror=unused-function] 37 | static int tegra_bpmp_bwmgr_max_freq_notifier(struct notifier_block *nb, unsigned long action, void *ptr) | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Fix this by ensuring the above functions are not defined if NV_TEGRA264_BWMGR_DEBUG_MACRO_PRESENT is not defined. Bug 5483386 Bug 5196455 Change-Id: Ie2b069d163a32220c95ffaba217ddea3686ba92b Signed-off-by: Jon Hunter Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3461865 Reviewed-by: Johnny Liu GVS: buildbot_gerritrpt --- drivers/platform/tegra/tegra-bpmp-bwmgr.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/platform/tegra/tegra-bpmp-bwmgr.c b/drivers/platform/tegra/tegra-bpmp-bwmgr.c index 0134ebfb..c8255859 100644 --- a/drivers/platform/tegra/tegra-bpmp-bwmgr.c +++ b/drivers/platform/tegra/tegra-bpmp-bwmgr.c @@ -34,6 +34,7 @@ struct tegra_bpmp_bwmgr { struct tegra_bpmp *bpmp; }; +#if defined(NV_TEGRA264_BWMGR_DEBUG_MACRO_PRESENT) static int tegra_bpmp_bwmgr_max_freq_notifier(struct notifier_block *nb, unsigned long action, void *ptr) { struct tegra_bpmp_bwmgr *bwmgr = container_of(nb, struct tegra_bpmp_bwmgr, max_freq_nb); @@ -71,6 +72,7 @@ static int tegra_bpmp_bwmgr_max_freq_notifier(struct notifier_block *nb, unsigne return err; } +#endif static int devfreq_gov_bwmgr_target_freq(struct devfreq *df, unsigned long *freq) { @@ -98,6 +100,7 @@ static struct devfreq_governor devfreq_gov_bwmgr = { .event_handler = devfreq_gov_bwmgr_event_handler, }; +#if defined(NV_TEGRA264_BWMGR_DEBUG_MACRO_PRESENT) static int tegra_bpmp_bwmgr_devfreq_target(struct device *dev, unsigned long *freq, u32 flags) { struct platform_device *pdev = to_platform_device(dev); @@ -112,9 +115,7 @@ static int tegra_bpmp_bwmgr_devfreq_target(struct device *dev, unsigned long *fr bwmgr_req.cmd = CMD_BWMGR_INT_CALC_AND_SET; bwmgr_req.bwmgr_calc_set_req.mc_floor = khz; bwmgr_req.bwmgr_calc_set_req.floor_unit = BWMGR_INT_UNIT_KHZ; -#if defined(NV_TEGRA264_BWMGR_DEBUG_MACRO_PRESENT) bwmgr_req.bwmgr_calc_set_req.client_id = TEGRA264_BWMGR_DEBUG; -#endif msg.mrq = MRQ_BWMGR_INT; msg.tx.data = &bwmgr_req; @@ -135,6 +136,7 @@ static int tegra_bpmp_bwmgr_devfreq_target(struct device *dev, unsigned long *fr return 0; } +#endif static int tegra_bpmp_bwmgr_devfreq_register(struct tegra_bpmp_bwmgr *bwmgr) {