disp: msm: avoid using #ifdef for configurations

Use #if IS_ENABLED() instead of #ifdef for configurations as vendor module
guidelines.

Use #if IS_ENABLED(CONFIG_XXX) instead of #ifdef CONFIG_XXX to ensure that
the code inside the #if block continues to compile if the config changes
to a tristate config in the future.

The differences are as follows:
	1.#if IS_ENABLED(CONFIG_XXX) evaluates to true when CONFIG_XXX is set to
		module (=m) or built-in (=y).
	2.#ifdef CONFIG_XXX evaluates to true when CONFIG_XXX is set to
		built-in(=y) , but doesn't when CONFIG_XXX is set to module(=m).
		Use this only when you're certain you want to do the same thing
		when the config is set to module or is disabled.

Change-Id: Ia806b9b01ad8414d0e4de027a382cb68e7fb4a6a
Signed-off-by: GG Hou <quic_renjhou@quicinc.com>
Šī revīzija ir iekļauta:
GG Hou
2021-12-07 16:10:51 +08:00
vecāks f42f39e4f8
revīzija e29493c71d
29 mainīti faili ar 97 papildinājumiem un 82 dzēšanām

Parādīt failu

@@ -1,4 +1,5 @@
/*
* Copyright (c) 2021-2022 Qualcomm Innovation Center, Inc. All rights reserved.
* Copyright (c) 2016-2021, The Linux Foundation. All rights reserved.
* Copyright (C) 2013 Red Hat
* Author: Rob Clark <robdclark@gmail.com>
@@ -119,10 +120,10 @@ struct msm_kms_funcs {
struct device *(*get_address_space_device)(
struct msm_kms *kms,
unsigned int domain);
#ifdef CONFIG_DEBUG_FS
#if IS_ENABLED(CONFIG_DEBUG_FS)
/* debugfs: */
int (*debugfs_init)(struct msm_kms *kms, struct drm_minor *minor);
#endif
#endif /* CONFIG_DEBUG_FS */
/* destroys debugfs */
void (*debugfs_destroy)(struct msm_kms *kms);
/* handle continuous splash */
@@ -170,12 +171,12 @@ static inline void msm_kms_init(struct msm_kms *kms,
kms->funcs = funcs;
}
#ifdef CONFIG_DRM_MSM_MDP4
#if IS_ENABLED(CONFIG_DRM_MSM_MDP4)
struct msm_kms *mdp4_kms_init(struct drm_device *dev);
#else
static inline
struct msm_kms *mdp4_kms_init(struct drm_device *dev) { return NULL; };
#endif
#endif /* CONFIG_DRM_MSM_MDP4 */
#if IS_ENABLED(CONFIG_DRM_MSM_MDP5)
struct msm_kms *mdp5_kms_init(struct drm_device *dev);
int msm_mdss_init(struct drm_device *dev);