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>
This commit is contained in:
@@ -1484,7 +1484,7 @@ void sde_dbg_ctrl(const char *name, ...)
|
||||
va_end(args);
|
||||
}
|
||||
|
||||
#ifdef CONFIG_DEBUG_FS
|
||||
#if IS_ENABLED(CONFIG_DEBUG_FS)
|
||||
/*
|
||||
* sde_dbg_debugfs_open - debugfs open handler for evtlog dump
|
||||
* @inode: debugfs inode
|
||||
@@ -2224,7 +2224,7 @@ static ssize_t sde_dbg_reg_base_offset_read(struct file *file,
|
||||
return len;
|
||||
}
|
||||
|
||||
#ifdef CONFIG_DYNAMIC_DEBUG
|
||||
#if IS_ENABLED(CONFIG_DYNAMIC_DEBUG)
|
||||
/**
|
||||
* sde_dbg_reg_base_reg_write - write to reg base hw at offset a given value
|
||||
* @file: file handler
|
||||
@@ -2302,7 +2302,7 @@ end:
|
||||
|
||||
return count;
|
||||
}
|
||||
#endif
|
||||
#endif /* CONFIG_DYNAMIC_DEBUG */
|
||||
|
||||
/**
|
||||
* sde_dbg_reg_base_reg_read - read len from reg base hw at current offset
|
||||
@@ -2504,7 +2504,7 @@ int sde_dbg_debugfs_register(struct device *dev)
|
||||
return 0;
|
||||
}
|
||||
|
||||
#endif
|
||||
#endif /* CONFIG_DEBUG_FS */
|
||||
|
||||
static void _sde_dbg_debugfs_destroy(void)
|
||||
{
|
||||
|
Reference in New Issue
Block a user