Commit 500589d8 authored by Arnd Bergmann's avatar Arnd Bergmann Committed by Greg Kroah-Hartman

coresight: etm4x: Fix unused function warning

Some of the newly added code in the etm4x driver is inside of an #ifdef,
and some other code is outside of it, leading to a harmless warning when
CONFIG_CPU_PM is disabled:

drivers/hwtracing/coresight/coresight-etm4x.c:68:13: error: 'etm4_os_lock' defined but not used [-Werror=unused-function]
 static void etm4_os_lock(struct etmv4_drvdata *drvdata)
             ^~~~~~~~~~~~

To avoid the warning and simplify the the #ifdef checks, use
IS_ENABLED() instead, so the compiler can drop the unused functions
without complaining.

Fixes: f188b5e7 ("coresight: etm4x: Save/restore state across CPU low power states")
Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
[Fixed capital 'f' in title]
Signed-off-by: default avatarMathieu Poirier <mathieu.poirier@linaro.org>
Link: https://lore.kernel.org/r/20191213223107.1484-2-mathieu.poirier@linaro.orgSigned-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent b3a987b0
...@@ -1132,7 +1132,6 @@ static void etm4_init_trace_id(struct etmv4_drvdata *drvdata) ...@@ -1132,7 +1132,6 @@ static void etm4_init_trace_id(struct etmv4_drvdata *drvdata)
drvdata->trcid = coresight_get_trace_id(drvdata->cpu); drvdata->trcid = coresight_get_trace_id(drvdata->cpu);
} }
#ifdef CONFIG_CPU_PM
static int etm4_cpu_save(struct etmv4_drvdata *drvdata) static int etm4_cpu_save(struct etmv4_drvdata *drvdata)
{ {
int i, ret = 0; int i, ret = 0;
...@@ -1402,17 +1401,17 @@ static struct notifier_block etm4_cpu_pm_nb = { ...@@ -1402,17 +1401,17 @@ static struct notifier_block etm4_cpu_pm_nb = {
static int etm4_cpu_pm_register(void) static int etm4_cpu_pm_register(void)
{ {
return cpu_pm_register_notifier(&etm4_cpu_pm_nb); if (IS_ENABLED(CONFIG_CPU_PM))
return cpu_pm_register_notifier(&etm4_cpu_pm_nb);
return 0;
} }
static void etm4_cpu_pm_unregister(void) static void etm4_cpu_pm_unregister(void)
{ {
cpu_pm_unregister_notifier(&etm4_cpu_pm_nb); if (IS_ENABLED(CONFIG_CPU_PM))
cpu_pm_unregister_notifier(&etm4_cpu_pm_nb);
} }
#else
static int etm4_cpu_pm_register(void) { return 0; }
static void etm4_cpu_pm_unregister(void) { }
#endif
static int etm4_probe(struct amba_device *adev, const struct amba_id *id) static int etm4_probe(struct amba_device *adev, const struct amba_id *id)
{ {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment