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>
Цей коміт міститься в:
GG Hou
2021-12-07 16:10:51 +08:00
джерело f42f39e4f8
коміт e29493c71d
29 змінених файлів з 97 додано та 82 видалено

Переглянути файл

@@ -85,7 +85,7 @@ static const struct of_device_id msm_dsi_of_match[] = {
{}
};
#ifdef CONFIG_DEBUG_FS
#if IS_ENABLED(CONFIG_DEBUG_FS)
static ssize_t debugfs_state_info_read(struct file *file,
char __user *buff,
size_t count,

Переглянути файл

@@ -1363,7 +1363,7 @@ int dsi_display_set_power(struct drm_connector *connector,
return rc;
}
#ifdef CONFIG_DEBUG_FS
#if IS_ENABLED(CONFIG_DEBUG_FS)
static bool dsi_display_is_te_based_esd(struct dsi_display *display)
{
u32 status_mode = 0;

Переглянути файл

@@ -1,5 +1,6 @@
/* SPDX-License-Identifier: GPL-2.0-only */
/*
* Copyright (c) 2021-2022 Qualcomm Innovation Center, Inc. All rights reserved.
* Copyright (c) 2018-2021, The Linux Foundation. All rights reserved.
*/
@@ -10,7 +11,7 @@
#include <linux/of_gpio.h>
#include <linux/version.h>
#ifdef CONFIG_DSI_PARSER
#if IS_ENABLED(CONFIG_DSI_PARSER)
void *dsi_parser_get(struct device *dev);
void dsi_parser_put(void *data);
int dsi_parser_dbg_init(void *parser, struct dentry *dir);