diff mbox series

coresight: platform: add OF/APCI dependency

Message ID 20190617125908.1674177-1-arnd@arndb.de (mailing list archive)
State New, archived
Headers show
Series coresight: platform: add OF/APCI dependency | expand

Commit Message

Arnd Bergmann June 17, 2019, 12:58 p.m. UTC
When neither CONFIG_OF nor CONFIG_ACPI are set, we get a harmless
build warning:

drivers/hwtracing/coresight/coresight-platform.c:26:12: error: unused function 'coresight_alloc_conns'
      [-Werror,-Wunused-function]
static int coresight_alloc_conns(struct device *dev,
           ^
drivers/hwtracing/coresight/coresight-platform.c:46:1: error: unused function 'coresight_find_device_by_fwnode'
      [-Werror,-Wunused-function]
coresight_find_device_by_fwnode(struct fwnode_handle *fwnode)

As the code is useless in that configuration anyway, just add
a Kconfig dependency that only allows building when at least
one of the two is set.

This should not hinder compile-testing, as CONFIG_OF can be
enabled on any architecture.

Fixes: ac0e232c12f0 ("coresight: platform: Use fwnode handle for device search")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 drivers/hwtracing/coresight/Kconfig | 1 +
 1 file changed, 1 insertion(+)

Comments

Suzuki K Poulose June 17, 2019, 1:19 p.m. UTC | #1
Hi Arnd,

On 17/06/2019 13:58, Arnd Bergmann wrote:
> When neither CONFIG_OF nor CONFIG_ACPI are set, we get a harmless
> build warning:
> 
> drivers/hwtracing/coresight/coresight-platform.c:26:12: error: unused function 'coresight_alloc_conns'
>        [-Werror,-Wunused-function]
> static int coresight_alloc_conns(struct device *dev,
>             ^
> drivers/hwtracing/coresight/coresight-platform.c:46:1: error: unused function 'coresight_find_device_by_fwnode'
>        [-Werror,-Wunused-function]
> coresight_find_device_by_fwnode(struct fwnode_handle *fwnode)
> 
> As the code is useless in that configuration anyway, just add
> a Kconfig dependency that only allows building when at least
> one of the two is set.
> 
> This should not hinder compile-testing, as CONFIG_OF can be
> enabled on any architecture.

Ok, that justifies why "not using ARM || ARM64" is better.


> 
> Fixes: ac0e232c12f0 ("coresight: platform: Use fwnode handle for device search")
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>

Reviewed-by: Suzuki K Poulose <suzuki.poulose@arm.com>

> ---
>   drivers/hwtracing/coresight/Kconfig | 1 +
>   1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/hwtracing/coresight/Kconfig b/drivers/hwtracing/coresight/Kconfig
> index 5487d4a1abc2..14638db4991d 100644
> --- a/drivers/hwtracing/coresight/Kconfig
> +++ b/drivers/hwtracing/coresight/Kconfig
> @@ -4,6 +4,7 @@
>   #
>   menuconfig CORESIGHT
>   	bool "CoreSight Tracing Support"
> +	depends on OF || ACPI
>   	select ARM_AMBA
>   	select PERF_EVENTS
>   	help
>
Mathieu Poirier June 17, 2019, 7:40 p.m. UTC | #2
On Mon, 17 Jun 2019 at 06:59, Arnd Bergmann <arnd@arndb.de> wrote:
>
> When neither CONFIG_OF nor CONFIG_ACPI are set, we get a harmless
> build warning:
>
> drivers/hwtracing/coresight/coresight-platform.c:26:12: error: unused function 'coresight_alloc_conns'
>       [-Werror,-Wunused-function]
> static int coresight_alloc_conns(struct device *dev,
>            ^
> drivers/hwtracing/coresight/coresight-platform.c:46:1: error: unused function 'coresight_find_device_by_fwnode'
>       [-Werror,-Wunused-function]
> coresight_find_device_by_fwnode(struct fwnode_handle *fwnode)
>
> As the code is useless in that configuration anyway, just add
> a Kconfig dependency that only allows building when at least
> one of the two is set.
>
> This should not hinder compile-testing, as CONFIG_OF can be
> enabled on any architecture.
>
> Fixes: ac0e232c12f0 ("coresight: platform: Use fwnode handle for device search")
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> ---
>  drivers/hwtracing/coresight/Kconfig | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/drivers/hwtracing/coresight/Kconfig b/drivers/hwtracing/coresight/Kconfig
> index 5487d4a1abc2..14638db4991d 100644
> --- a/drivers/hwtracing/coresight/Kconfig
> +++ b/drivers/hwtracing/coresight/Kconfig
> @@ -4,6 +4,7 @@
>  #
>  menuconfig CORESIGHT
>         bool "CoreSight Tracing Support"
> +       depends on OF || ACPI

I have applied this - thanks,
Mathieu

>         select ARM_AMBA
>         select PERF_EVENTS
>         help
> --
> 2.20.0
>
diff mbox series

Patch

diff --git a/drivers/hwtracing/coresight/Kconfig b/drivers/hwtracing/coresight/Kconfig
index 5487d4a1abc2..14638db4991d 100644
--- a/drivers/hwtracing/coresight/Kconfig
+++ b/drivers/hwtracing/coresight/Kconfig
@@ -4,6 +4,7 @@ 
 #
 menuconfig CORESIGHT
 	bool "CoreSight Tracing Support"
+	depends on OF || ACPI
 	select ARM_AMBA
 	select PERF_EVENTS
 	help