[PATCH v8 03/24] coresight: use IS_ENABLED for CONFIGs that may be modules
Mathieu Poirier
mathieu.poirier at linaro.org
Wed Aug 12 13:54:49 EDT 2020
On Fri, Aug 07, 2020 at 07:11:32PM +0800, Tingwei Zhang wrote:
> From: Kim Phillips <kim.phillips at arm.com>
>
> Checking for ifdef CONFIG_x fails if CONFIG_x=m. Use IS_ENABLED
> that is true for both built-ins and modules, instead. Required
> when building coresight components as modules.
>
> Cc: Mathieu Poirier <mathieu.poirier at linaro.org>
> Cc: Leo Yan <leo.yan at linaro.org>
> Cc: Alexander Shishkin <alexander.shishkin at linux.intel.com>
> Cc: Randy Dunlap <rdunlap at infradead.org>
> Cc: Suzuki K Poulose <Suzuki.Poulose at arm.com>
> Cc: Greg Kroah-Hartman <gregkh at linuxfoundation.org>
> Cc: Russell King <linux at armlinux.org.uk>
> Signed-off-by: Kim Phillips <kim.phillips at arm.com>
> Signed-off-by: Tingwei Zhang <tingwei at codeaurora.org>
> Reviewed-by: Suzuki K Poulose <suzuki.poulose at arm.com>
> ---
> drivers/hwtracing/coresight/coresight-etm-perf.h | 2 +-
> drivers/hwtracing/coresight/coresight-priv.h | 2 +-
> include/linux/coresight.h | 2 +-
> 3 files changed, 3 insertions(+), 3 deletions(-)
For patches 02 and 03:
Reviewed-by: Mathieu Poirier <mathieu.poirier at linaro.org>
>
> diff --git a/drivers/hwtracing/coresight/coresight-etm-perf.h b/drivers/hwtracing/coresight/coresight-etm-perf.h
> index 015213abe00a..05f89723e282 100644
> --- a/drivers/hwtracing/coresight/coresight-etm-perf.h
> +++ b/drivers/hwtracing/coresight/coresight-etm-perf.h
> @@ -57,7 +57,7 @@ struct etm_event_data {
> struct list_head * __percpu *path;
> };
>
> -#ifdef CONFIG_CORESIGHT
> +#if IS_ENABLED(CONFIG_CORESIGHT)
> int etm_perf_symlink(struct coresight_device *csdev, bool link);
> int etm_perf_add_symlink_sink(struct coresight_device *csdev);
> void etm_perf_del_symlink_sink(struct coresight_device *csdev);
> diff --git a/drivers/hwtracing/coresight/coresight-priv.h b/drivers/hwtracing/coresight/coresight-priv.h
> index f2dc625ea585..d801a2755432 100644
> --- a/drivers/hwtracing/coresight/coresight-priv.h
> +++ b/drivers/hwtracing/coresight/coresight-priv.h
> @@ -165,7 +165,7 @@ int coresight_make_links(struct coresight_device *orig,
> void coresight_remove_links(struct coresight_device *orig,
> struct coresight_connection *conn);
>
> -#ifdef CONFIG_CORESIGHT_SOURCE_ETM3X
> +#if IS_ENABLED(CONFIG_CORESIGHT_SOURCE_ETM3X)
> extern int etm_readl_cp14(u32 off, unsigned int *val);
> extern int etm_writel_cp14(u32 off, u32 val);
> #else
> diff --git a/include/linux/coresight.h b/include/linux/coresight.h
> index 58fffdecdbfd..3bb738f9a326 100644
> --- a/include/linux/coresight.h
> +++ b/include/linux/coresight.h
> @@ -324,7 +324,7 @@ struct coresight_ops {
> const struct coresight_ops_ect *ect_ops;
> };
>
> -#ifdef CONFIG_CORESIGHT
> +#if IS_ENABLED(CONFIG_CORESIGHT)
> extern struct coresight_device *
> coresight_register(struct coresight_desc *desc);
> extern void coresight_unregister(struct coresight_device *csdev);
> --
> The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
> a Linux Foundation Collaborative Project
>
More information about the linux-arm-kernel
mailing list