Bläddra i källkod

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 <[email protected]>
GG Hou 3 år sedan
förälder
incheckning
e29493c71d

+ 3 - 2
msm/dp/dp_aux.c

@@ -1,5 +1,6 @@
 // SPDX-License-Identifier: GPL-2.0-only
 /*
+ * Copyright (c) 2021-2022 Qualcomm Innovation Center, Inc. All rights reserved.
  * Copyright (c) 2012-2021, The Linux Foundation. All rights reserved.
  */
 
@@ -46,7 +47,7 @@ struct dp_aux_private {
 	atomic_t aborted;
 };
 
-#ifdef CONFIG_DYNAMIC_DEBUG
+#if IS_ENABLED(CONFIG_DYNAMIC_DEBUG)
 static void dp_aux_hex_dump(struct drm_dp_aux *drm_aux,
 		struct drm_dp_aux_msg *msg)
 {
@@ -77,7 +78,7 @@ static void dp_aux_hex_dump(struct drm_dp_aux *drm_aux,
 		struct drm_dp_aux_msg *msg)
 {
 }
-#endif
+#endif /* CONFIG_DYNAMIC_DEBUG */
 
 static char *dp_aux_get_error(u32 aux_error)
 {

+ 3 - 2
msm/dp/dp_aux_bridge.c

@@ -1,4 +1,5 @@
 /*
+ * Copyright (c) 2021-2022 Qualcomm Innovation Center, Inc. All rights reserved.
  * Copyright (c) 2019-2021, The Linux Foundation. All rights reserved.
  *
  * This program is free software; you can redistribute it and/or modify
@@ -49,7 +50,7 @@ int dp_aux_add_bridge(struct dp_aux_bridge *bridge)
 	return 0;
 }
 
-#ifdef CONFIG_OF
+#if IS_ENABLED(CONFIG_OF)
 struct dp_aux_bridge *of_dp_aux_find_bridge(struct device_node *np)
 {
 	struct dp_aux_bridge *bridge;
@@ -66,5 +67,5 @@ struct dp_aux_bridge *of_dp_aux_find_bridge(struct device_node *np)
 	mutex_unlock(&dp_aux_bridge_lock);
 	return NULL;
 }
-#endif
+#endif /* CONFIG_OF */
 

+ 5 - 4
msm/dp/dp_aux_bridge.h

@@ -1,4 +1,5 @@
 /*
+ * Copyright (c) 2021-2022 Qualcomm Innovation Center, Inc. All rights reserved.
  * Copyright (c) 2019-2021, The Linux Foundation. All rights reserved.
  *
  * This program is free software; you can redistribute it and/or modify
@@ -59,9 +60,9 @@ enum dp_aux_bridge_flag {
  * @head: to keep track of all added bridges
  */
 struct dp_aux_bridge {
-#ifdef CONFIG_OF
+#if IS_ENABLED(CONFIG_OF)
 	struct device_node *of_node;
-#endif
+#endif /* CONFIG_OF */
 	void *dev_priv;
 	u32 flag;
 	void *mst_ctx;
@@ -116,14 +117,14 @@ struct dp_aux_bridge {
  */
 int dp_aux_add_bridge(struct dp_aux_bridge *bridge);
 
-#ifdef CONFIG_OF
+#if IS_ENABLED(CONFIG_OF)
 /**
  * of_dp_aux_find_bridge - Find registered DP aux bridge
  * @np: device node pointer to the bridge
  * return: DP aux bridge pointer, NULL if not found
  */
 struct dp_aux_bridge *of_dp_aux_find_bridge(struct device_node *np);
-#endif
+#endif /* CONFIG_OF */
 
 #endif /* _DP_AUX_BRIDGE_H_ */
 

+ 3 - 3
msm/dp/dp_mst_sim.c

@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2021 Qualcomm Innovation Center, Inc. All rights reserved.
+ * Copyright (c) 2021-2022 Qualcomm Innovation Center, Inc. All rights reserved.
  * Copyright (c) 2019-2021, The Linux Foundation. All rights reserved.
  *
  * This program is free software; you can redistribute it and/or modify
@@ -87,7 +87,7 @@ static const struct dp_mst_sim_port output_port = {
 	0, 0, 2520, 2520, NULL, 0
 };
 
-#ifdef CONFIG_DYNAMIC_DEBUG
+#if IS_ENABLED(CONFIG_DYNAMIC_DEBUG)
 static void dp_sim_aux_hex_dump(struct drm_dp_aux_msg *msg)
 {
 	char prefix[64];
@@ -114,7 +114,7 @@ static void dp_sim_aux_hex_dump(struct drm_dp_aux_msg *msg)
 static void dp_sim_aux_hex_dump(struct drm_dp_aux_msg *msg)
 {
 }
-#endif
+#endif /* CONFIG_DYNAMIC_DEBUG */
 
 static int dp_sim_register_hpd(struct dp_aux_bridge *bridge,
 	int (*hpd_cb)(void *, bool, bool), void *dev)

+ 3 - 2
msm/dp/dp_mst_sim_helper.c

@@ -1,4 +1,5 @@
 /*
+ * Copyright (c) 2021-2022 Qualcomm Innovation Center, Inc. All rights reserved.
  * Copyright (c) 2019-2021, The Linux Foundation. All rights reserved.
  *
  * This program is free software; you can redistribute it and/or modify
@@ -84,7 +85,7 @@ struct dp_mst_notify_work {
 	u32 port_mask;
 };
 
-#ifdef CONFIG_DYNAMIC_DEBUG
+#if IS_ENABLED(CONFIG_DYNAMIC_DEBUG)
 static void dp_sideband_hex_dump(const char *name,
 		u32 address, u8 *buffer, size_t size)
 {
@@ -111,7 +112,7 @@ static void dp_sideband_hex_dump(const char *name,
 		u32 address, u8 *buffer, size_t size)
 {
 }
-#endif
+#endif /* CONFIG_DYNAMIC_DEBUG */
 
 static u8 dp_mst_sim_msg_header_crc4(const uint8_t *data, size_t num_nibbles)
 {

+ 1 - 1
msm/dsi/dsi_ctrl.c

@@ -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,

+ 1 - 1
msm/dsi/dsi_display.c

@@ -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;

+ 2 - 1
msm/dsi/dsi_parser.h

@@ -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);

+ 3 - 2
msm/msm_cooling_device.h

@@ -1,5 +1,6 @@
 /* SPDX-License-Identifier: GPL-2.0-only */
 /*
+ * Copyright (c) 2021-2022 Qualcomm Innovation Center, Inc. All rights reserved.
  * Copyright (c) 2020-2021 The Linux Foundation. All rights reserved.
  */
 
@@ -19,7 +20,7 @@ struct sde_cdev {
 	unsigned int cdev_sf;
 };
 
-#ifdef CONFIG_THERMAL_OF
+#if IS_ENABLED(CONFIG_THERMAL_OF)
 struct sde_cdev *backlight_cdev_register(struct device *dev,
 					struct backlight_device *bd,
 					struct notifier_block *n);
@@ -33,6 +34,6 @@ backlight_cdev_register(struct device *dev,
 }
 static inline void backlight_cdev_unregister(struct sde_cdev *cdev)
 { }
-#endif
+#endif /* CONFIG_THERMAL_OF */
 
 #endif

+ 16 - 16
msm/msm_drv.c

@@ -169,19 +169,19 @@ static const struct drm_mode_config_helper_funcs mode_config_helper_funcs = {
 	.atomic_commit_tail = msm_atomic_commit_tail,
 };
 
-#ifdef CONFIG_DRM_MSM_REGISTER_LOGGING
+#if IS_ENABLED(CONFIG_DRM_MSM_REGISTER_LOGGING)
 static bool reglog = false;
 MODULE_PARM_DESC(reglog, "Enable register read/write logging");
 module_param(reglog, bool, 0600);
 #else
 #define reglog 0
-#endif
+#endif /* CONFIG_DRM_MSM_REGISTER_LOGGING */
 
-#ifdef CONFIG_DRM_FBDEV_EMULATION
+#if IS_ENABLED(CONFIG_DRM_FBDEV_EMULATION)
 static bool fbdev = true;
 MODULE_PARM_DESC(fbdev, "Enable fbdev compat layer");
 module_param(fbdev, bool, 0600);
-#endif
+#endif /* CONFIG_DRM_FBDEV_EMULATION */
 
 static char *vram = "16m";
 MODULE_PARM_DESC(vram, "Configure VRAM size (for devices without IOMMU/GPUMMU)");
@@ -508,10 +508,10 @@ static int msm_drm_uninit(struct device *dev)
 		priv->registered = false;
 	}
 
-#ifdef CONFIG_DRM_FBDEV_EMULATION
+#if IS_ENABLED(CONFIG_DRM_FBDEV_EMULATION)
 	if (fbdev && priv->fbdev)
 		msm_fbdev_free(ddev);
-#endif
+#endif /* CONFIG_DRM_FBDEV_EMULATION */
 	drm_atomic_helper_shutdown(ddev);
 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 15, 0))
 	msm_irq_uninstall(ddev);
@@ -562,7 +562,7 @@ static int msm_drm_uninit(struct device *dev)
 
 static int get_mdp_ver(struct platform_device *pdev)
 {
-#ifdef CONFIG_OF
+#if IS_ENABLED(CONFIG_OF)
 	static const struct of_device_id match_types[] = { {
 		.compatible = "qcom,mdss_mdp",
 		.data	= (void	*)KMS_MDP5,
@@ -579,7 +579,7 @@ static int get_mdp_ver(struct platform_device *pdev)
 	match = of_match_node(match_types, dev->of_node);
 	if (match)
 		return (int)(unsigned long)match->data;
-#endif
+#endif /* CONFIG_OF */
 	return KMS_MDP4;
 }
 
@@ -662,7 +662,7 @@ static int msm_init_vram(struct drm_device *dev)
 	return ret;
 }
 
-#ifdef CONFIG_OF
+#if IS_ENABLED(CONFIG_OF)
 static int msm_component_bind_all(struct device *dev,
 				struct drm_device *drm_dev)
 {
@@ -680,7 +680,7 @@ static int msm_component_bind_all(struct device *dev,
 {
 	return 0;
 }
-#endif
+#endif /* CONFIG_OF */
 
 static int msm_drm_display_thread_create(struct msm_drm_private *priv, struct drm_device *ddev,
 	struct device *dev)
@@ -977,10 +977,10 @@ static int msm_drm_component_init(struct device *dev)
 		}
 	}
 
-#ifdef CONFIG_DRM_FBDEV_EMULATION
+#if IS_ENABLED(CONFIG_DRM_FBDEV_EMULATION)
 	if (fbdev)
 		priv->fbdev = msm_fbdev_init(ddev);
-#endif
+#endif /* CONFIG_DRM_FBDEV_EMULATION */
 
 	/* create drm client only when fbdev is not supported */
 	if (!priv->fbdev) {
@@ -1799,7 +1799,7 @@ static struct drm_driver msm_driver = {
 	.patchlevel         = MSM_VERSION_PATCHLEVEL,
 };
 
-#ifdef CONFIG_PM_SLEEP
+#if IS_ENABLED(CONFIG_PM_SLEEP)
 static int msm_pm_suspend(struct device *dev)
 {
 	struct drm_device *ddev;
@@ -1849,9 +1849,9 @@ static int msm_pm_resume(struct device *dev)
 
 	return 0;
 }
-#endif
+#endif /* CONFIG_PM_SLEEP */
 
-#ifdef CONFIG_PM
+#if IS_ENABLED(CONFIG_PM)
 static int msm_runtime_suspend(struct device *dev)
 {
 	struct drm_device *ddev = dev_get_drvdata(dev);
@@ -1882,7 +1882,7 @@ static int msm_runtime_resume(struct device *dev)
 
 	return ret;
 }
-#endif
+#endif /* CONFIG_PM */
 
 static const struct dev_pm_ops msm_pm_ops = {
 	SET_SYSTEM_SLEEP_PM_OPS(msm_pm_suspend, msm_pm_resume)

+ 2 - 2
msm/msm_drv.h

@@ -1302,7 +1302,7 @@ static inline void __exit msm_mdp_unregister(void)
 }
 #endif /* CONFIG_DRM_MSM_MDP5 */
 
-#ifdef CONFIG_DEBUG_FS
+#if IS_ENABLED(CONFIG_DEBUG_FS)
 int msm_debugfs_late_init(struct drm_device *dev);
 int msm_rd_debugfs_init(struct drm_minor *minor);
 void msm_rd_debugfs_cleanup(struct msm_drm_private *priv);
@@ -1318,7 +1318,7 @@ static inline void msm_rd_dump_submit(struct msm_rd_state *rd, struct msm_gem_su
 		const char *fmt, ...) {}
 static inline void msm_rd_debugfs_cleanup(struct msm_drm_private *priv) {}
 static inline void msm_perf_debugfs_cleanup(struct msm_drm_private *priv) {}
-#endif
+#endif /* CONFIG_DEBUG_FS */
 
 #if IS_ENABLED(CONFIG_DRM_MSM_DSI)
 void __init dsi_display_register(void);

+ 5 - 4
msm/msm_kms.h

@@ -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 <[email protected]>
@@ -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);

+ 3 - 2
msm/sde/sde_connector.c

@@ -1,5 +1,6 @@
 // SPDX-License-Identifier: GPL-2.0-only
 /*
+ * Copyright (c) 2021-2022 Qualcomm Innovation Center, Inc. All rights reserved.
  * Copyright (c) 2016-2021, The Linux Foundation. All rights reserved.
  */
 
@@ -2422,7 +2423,7 @@ static const struct file_operations conn_cmd_rx_fops = {
 	.write =        _sde_debugfs_conn_cmd_rx_write,
 };
 
-#ifdef CONFIG_DEBUG_FS
+#if IS_ENABLED(CONFIG_DEBUG_FS)
 /**
  * sde_connector_init_debugfs - initialize connector debugfs
  * @connector: Pointer to drm connector
@@ -2472,7 +2473,7 @@ static int sde_connector_init_debugfs(struct drm_connector *connector)
 {
 	return 0;
 }
-#endif
+#endif /* CONFIG_DEBUG_FS */
 
 static int sde_connector_late_register(struct drm_connector *connector)
 {

+ 2 - 2
msm/sde/sde_core_irq.c

@@ -353,7 +353,7 @@ static void sde_disable_all_irqs(struct sde_kms *sde_kms)
 	sde_kms->hw_intr->ops.disable_all_irqs(sde_kms->hw_intr);
 }
 
-#ifdef CONFIG_DEBUG_FS
+#if IS_ENABLED(CONFIG_DEBUG_FS)
 #define DEFINE_SDE_DEBUGFS_SEQ_FOPS(__prefix)				\
 static int __prefix ## _open(struct inode *inode, struct file *file)	\
 {									\
@@ -424,7 +424,7 @@ int sde_debugfs_core_irq_init(struct sde_kms *sde_kms,
 void sde_debugfs_core_irq_destroy(struct sde_kms *sde_kms)
 {
 }
-#endif
+#endif /* CONFIG_DEBUG_FS */
 
 void sde_core_irq_preinstall(struct sde_kms *sde_kms)
 {

+ 3 - 3
msm/sde/sde_core_perf.c

@@ -1,6 +1,6 @@
 // SPDX-License-Identifier: GPL-2.0-only
 /*
- * Copyright (c) 2021 Qualcomm Innovation Center, Inc. All rights reserved.
+ * Copyright (c) 2021-2022 Qualcomm Innovation Center, Inc. All rights reserved.
  * Copyright (c) 2016-2021, The Linux Foundation. All rights reserved.
  */
 
@@ -1084,7 +1084,7 @@ void sde_core_perf_crtc_update(struct drm_crtc *crtc,
 
 }
 
-#ifdef CONFIG_DEBUG_FS
+#if IS_ENABLED(CONFIG_DEBUG_FS)
 
 static ssize_t _sde_core_perf_threshold_high_write(struct file *file,
 		    const char __user *user_buf, size_t count, loff_t *ppos)
@@ -1409,7 +1409,7 @@ int sde_core_perf_debugfs_init(struct sde_core_perf *perf,
 {
 	return 0;
 }
-#endif
+#endif /* CONFIG_DEBUG_FS */
 
 void sde_core_perf_destroy(struct sde_core_perf *perf)
 {

+ 3 - 3
msm/sde/sde_crtc.c

@@ -308,7 +308,7 @@ static void _sde_crtc_deinit_events(struct sde_crtc *sde_crtc)
 		return;
 }
 
-#ifdef CONFIG_DEBUG_FS
+#if IS_ENABLED(CONFIG_DEBUG_FS)
 static int _sde_debugfs_fps_status_show(struct seq_file *s, void *data)
 {
 	struct sde_crtc *sde_crtc;
@@ -355,7 +355,7 @@ static int _sde_debugfs_fps_status(struct inode *inode, struct file *file)
 	return single_open(file, _sde_debugfs_fps_status_show,
 			inode->i_private);
 }
-#endif
+#endif /* CONFIG_DEBUG_FS */
 
 static ssize_t fps_periodicity_ms_store(struct device *device,
 		struct device_attribute *attr, const char *buf, size_t count)
@@ -6440,7 +6440,7 @@ void sde_crtc_get_misr_info(struct drm_crtc *crtc,
 	crtc_misr_info->misr_frame_count = sde_crtc->misr_frame_count;
 }
 
-#ifdef CONFIG_DEBUG_FS
+#if IS_ENABLED(CONFIG_DEBUG_FS)
 static int _sde_debugfs_status_show(struct seq_file *s, void *data)
 {
 	struct sde_crtc *sde_crtc;

+ 2 - 2
msm/sde/sde_encoder.c

@@ -4695,7 +4695,7 @@ int sde_encoder_helper_collect_misr(struct sde_encoder_phys *phys_enc,
 			nonblock, misr_value) : -ENOTSUPP;
 }
 
-#ifdef CONFIG_DEBUG_FS
+#if IS_ENABLED(CONFIG_DEBUG_FS)
 static int _sde_encoder_status_show(struct seq_file *s, void *data)
 {
 	struct sde_encoder_virt *sde_enc;
@@ -4966,7 +4966,7 @@ static int _sde_encoder_init_debugfs(struct drm_encoder *drm_enc)
 static void _sde_encoder_destroy_debugfs(struct drm_encoder *drm_enc)
 {
 }
-#endif
+#endif /* CONFIG_DEBUG_FS */
 
 static int sde_encoder_late_register(struct drm_encoder *encoder)
 {

+ 2 - 2
msm/sde/sde_encoder_phys_wb.c

@@ -2250,7 +2250,7 @@ static void sde_encoder_phys_wb_get_hw_resources(struct sde_encoder_phys *phys_e
 		WBID(wb_enc), hw_res->wbs[hw_wb->idx - WB_0], hw_res->needs_cdm);
 }
 
-#ifdef CONFIG_DEBUG_FS
+#if IS_ENABLED(CONFIG_DEBUG_FS)
 /**
  * sde_encoder_phys_wb_init_debugfs - initialize writeback encoder debugfs
  * @phys_enc:		Pointer to physical encoder
@@ -2274,7 +2274,7 @@ static int sde_encoder_phys_wb_init_debugfs(
 {
 	return 0;
 }
-#endif
+#endif /* CONFIG_DEBUG_FS */
 
 static int sde_encoder_phys_wb_late_register(struct sde_encoder_phys *phys_enc,
 		struct dentry *debugfs_root)

+ 2 - 2
msm/sde/sde_kms.c

@@ -123,7 +123,7 @@ bool sde_is_custom_client(void)
 	return sdecustom;
 }
 
-#ifdef CONFIG_DEBUG_FS
+#if IS_ENABLED(CONFIG_DEBUG_FS)
 void *sde_debugfs_get_root(struct sde_kms *sde_kms)
 {
 	struct msm_drm_private *priv;
@@ -211,7 +211,7 @@ static int _sde_kms_dump_clks_state(struct sde_kms *sde_kms)
 {
 	return 0;
 }
-#endif
+#endif /* CONFIG_DEBUG_FS */
 
 static void sde_kms_wait_for_frame_transfer_complete(struct msm_kms *kms,
 		struct drm_crtc *crtc)

+ 2 - 2
msm/sde/sde_plane.c

@@ -4498,7 +4498,7 @@ void sde_plane_get_frame_data(struct drm_plane *plane,
 	}
 }
 
-#ifdef CONFIG_DEBUG_FS
+#if IS_ENABLED(CONFIG_DEBUG_FS)
 static ssize_t _sde_plane_danger_read(struct file *file,
 			char __user *buff, size_t count, loff_t *ppos)
 {
@@ -4699,7 +4699,7 @@ static int _sde_plane_init_debugfs(struct drm_plane *plane)
 static void _sde_plane_destroy_debugfs(struct drm_plane *plane)
 {
 }
-#endif
+#endif /* CONFIG_DEBUG_FS */
 
 static int sde_plane_late_register(struct drm_plane *plane)
 {

+ 3 - 2
msm/sde/sde_rm.c

@@ -1,5 +1,6 @@
 // SPDX-License-Identifier: GPL-2.0-only
 /*
+ * Copyright (c) 2021-2022 Qualcomm Innovation Center, Inc. All rights reserved.
  * Copyright (c) 2016-2021, The Linux Foundation. All rights reserved.
  */
 
@@ -807,7 +808,7 @@ fail:
 	return rc;
 }
 
-#ifdef CONFIG_DEBUG_FS
+#if IS_ENABLED(CONFIG_DEBUG_FS)
 static int _sde_rm_status_show(struct seq_file *s, void *data)
 {
 	struct sde_rm *rm;
@@ -853,7 +854,7 @@ void sde_rm_debugfs_init(struct sde_rm *sde_rm, struct dentry *parent)
 void sde_rm_debugfs_init(struct sde_rm *rm, struct dentry *parent)
 {
 }
-#endif
+#endif /* CONFIG_DEBUG_FS */
 
 int sde_rm_init(struct sde_rm *rm,
 		struct sde_mdss_cfg *cat,

+ 2 - 2
msm/sde/sde_vbif.c

@@ -771,7 +771,7 @@ int sde_vbif_halt_xin_mask(struct sde_kms *sde_kms, u32 xin_id_mask,
 	return 0;
 }
 
-#ifdef CONFIG_DEBUG_FS
+#if IS_ENABLED(CONFIG_DEBUG_FS)
 void sde_debugfs_vbif_destroy(struct sde_kms *sde_kms)
 {
 	debugfs_remove_recursive(sde_kms->debugfs_vbif);
@@ -841,4 +841,4 @@ int sde_debugfs_vbif_init(struct sde_kms *sde_kms, struct dentry *debugfs_root)
 
 	return 0;
 }
-#endif
+#endif /* CONFIG_DEBUG_FS */

+ 3 - 2
msm/sde/sde_vbif.h

@@ -1,5 +1,6 @@
 /* SPDX-License-Identifier: GPL-2.0-only */
 /*
+ * Copyright (c) 2021-2022 Qualcomm Innovation Center, Inc. All rights reserved.
  * Copyright (c) 2016-2021, The Linux Foundation. All rights reserved.
  */
 
@@ -157,7 +158,7 @@ int sde_vbif_halt_plane_xin(struct sde_kms *sde_kms, u32 xin_id,
  */
 int sde_vbif_halt_xin_mask(struct sde_kms *sde_kms, u32 xin_id_mask, bool halt);
 
-#ifdef CONFIG_DEBUG_FS
+#if IS_ENABLED(CONFIG_DEBUG_FS)
 int sde_debugfs_vbif_init(struct sde_kms *sde_kms, struct dentry *debugfs_root);
 void sde_debugfs_vbif_destroy(struct sde_kms *sde_kms);
 #else
@@ -169,5 +170,5 @@ static inline int sde_debugfs_vbif_init(struct sde_kms *sde_kms,
 static inline void sde_debugfs_vbif_destroy(struct sde_kms *sde_kms)
 {
 }
-#endif
+#endif /* CONFIG_DEBUG_FS */
 #endif /* __SDE_VBIF_H__ */

+ 4 - 4
msm/sde_dbg.c

@@ -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)
 {

+ 3 - 2
rotator/sde_rotator_base.h

@@ -1,5 +1,6 @@
 /* SPDX-License-Identifier: GPL-2.0-only */
 /*
+ * Copyright (c) 2021-2022 Qualcomm Innovation Center, Inc. All rights reserved.
  * Copyright (c) 2015-2021, The Linux Foundation. All rights reserved.
  */
 
@@ -310,14 +311,14 @@ int sde_rotator_base_init(struct sde_rot_data_type **pmdata,
 
 void sde_rotator_base_destroy(struct sde_rot_data_type *data);
 
-#ifdef CONFIG_MSM_SDE_ROTATOR
+#if IS_ENABLED(CONFIG_MSM_SDE_ROTATOR)
 struct sde_rot_data_type *sde_rot_get_mdata(void);
 #else
 static inline struct sde_rot_data_type *sde_rot_get_mdata(void)
 {
 	return NULL;
 }
-#endif
+#endif /* CONFIG_MSM_SDE_ROTATOR */
 
 struct reg_bus_client *sde_reg_bus_vote_client_create(char *client_name);
 

+ 3 - 2
rotator/sde_rotator_core.c

@@ -1,5 +1,6 @@
 // SPDX-License-Identifier: GPL-2.0-only
 /*
+ * Copyright (c) 2021-2022 Qualcomm Innovation Center, Inc. All rights reserved.
  * Copyright (c) 2015-2020, The Linux Foundation. All rights reserved.
  */
 
@@ -3320,7 +3321,7 @@ int sde_rotator_runtime_idle(struct device *dev)
 
 #endif
 
-#ifdef CONFIG_PM_SLEEP
+#if IS_ENABLED(CONFIG_PM_SLEEP)
 /*
  * sde_rotator_pm_suspend - put the device in pm suspend state by cancelling
  *							 all active requests
@@ -3382,7 +3383,7 @@ int sde_rotator_pm_resume(struct device *dev)
 	sde_rot_mgr_unlock(mgr);
 	return 0;
 }
-#endif
+#endif /* CONFIG_PM_SLEEP */
 
 #if defined(CONFIG_PM) && !defined(CONFIG_PM_SLEEP)
 int sde_rotator_suspend(struct platform_device *dev, pm_message_t state)

+ 3 - 2
rotator/sde_rotator_debug.c

@@ -1,5 +1,6 @@
 // SPDX-License-Identifier: GPL-2.0-only
 /*
+ * Copyright (c) 2021-2022 Qualcomm Innovation Center, Inc. All rights reserved.
  * Copyright (c) 2015-2021, The Linux Foundation. All rights reserved.
  */
 #define pr_fmt(fmt)	"%s: " fmt, __func__
@@ -16,11 +17,11 @@
 #include "sde_rotator_dev.h"
 #include "sde_rotator_trace.h"
 
-#ifdef CONFIG_MSM_SDE_ROTATOR_EVTLOG_DEBUG
+#if IS_ENABLED(CONFIG_MSM_SDE_ROTATOR_EVTLOG_DEBUG)
 #define SDE_EVTLOG_DEFAULT_ENABLE 1
 #else
 #define SDE_EVTLOG_DEFAULT_ENABLE 0
-#endif
+#endif /* CONFIG_MSM_SDE_ROTATOR_EVTLOG_DEBUG */
 #define SDE_EVTLOG_DEFAULT_PANIC 1
 #define SDE_EVTLOG_DEFAULT_REGDUMP SDE_ROT_DBG_DUMP_IN_MEM
 #define SDE_EVTLOG_DEFAULT_VBIF_DBGBUSDUMP SDE_ROT_DBG_DUMP_IN_MEM

+ 7 - 6
rotator/sde_rotator_dev.c

@@ -1,5 +1,6 @@
 // SPDX-License-Identifier: GPL-2.0-only
 /*
+ * Copyright (c) 2021-2022 Qualcomm Innovation Center, Inc. All rights reserved.
  * Copyright (c) 2015-2020, The Linux Foundation. All rights reserved.
  */
 #define pr_fmt(fmt)	"%s:%d: " fmt, __func__, __LINE__
@@ -56,10 +57,10 @@
 #ifndef CONFIG_MSM_SDE_ROTATOR_INIT_ONLY
 static void sde_rotator_submit_handler(struct kthread_work *work);
 static void sde_rotator_retire_handler(struct kthread_work *work);
-#ifdef CONFIG_COMPAT
+#if IS_ENABLED(CONFIG_COMPAT)
 static long sde_rotator_compat_ioctl32(struct file *file,
 	unsigned int cmd, unsigned long arg);
-#endif
+#endif /* CONFIG_COMPAT */
 
 /*
  * sde_rotator_ctx_from_fh - Get rotator context from v4l2 fh.
@@ -1909,9 +1910,9 @@ static const struct v4l2_file_operations sde_rotator_fops = {
 	.release        = sde_rotator_release,
 	.poll           = sde_rotator_poll,
 	.unlocked_ioctl = video_ioctl2,
-#ifdef CONFIG_COMPAT
+#if IS_ENABLED(CONFIG_COMPAT)
 	.compat_ioctl32 = sde_rotator_compat_ioctl32,
-#endif
+#endif /* CONFIG_COMPAT */
 };
 
 /*
@@ -2740,7 +2741,7 @@ static long sde_rotator_private_ioctl(struct file *file, void *fh,
 	return 0;
 }
 
-#ifdef CONFIG_COMPAT
+#if IS_ENABLED(CONFIG_COMPAT)
 /*
  * sde_rotator_compat_ioctl32 - Compat ioctl handler function.
  * @file: Pointer to file struct.
@@ -2809,7 +2810,7 @@ ioctl32_error:
 	SDEDEV_ERR(ctx->rot_dev->dev, "error handling ioctl32 cmd:%x\n", cmd);
 	return -EFAULT;
 }
-#endif
+#endif /* CONFIG_COMPAT */
 
 static int sde_rotator_ctrl_subscribe_event(struct v4l2_fh *fh,
 				const struct v4l2_event_subscription *sub)

+ 3 - 2
rotator/sde_rotator_smmu.h

@@ -1,5 +1,6 @@
 /* SPDX-License-Identifier: GPL-2.0-only */
 /*
+ * Copyright (c) 2021-2022 Qualcomm Innovation Center, Inc. All rights reserved.
  * Copyright (c) 2015-2021, The Linux Foundation. All rights reserved.
  */
 
@@ -25,14 +26,14 @@ static inline int sde_smmu_dma_data_direction(int dir)
 	return dir;
 }
 
-#ifdef CONFIG_MSM_SDE_ROTATOR
+#if IS_ENABLED(CONFIG_MSM_SDE_ROTATOR)
 int sde_smmu_ctrl(int enable);
 #else
 static inline int sde_smmu_ctrl(int enable)
 {
 	return 0;
 }
-#endif
+#endif /* CONFIG_MSM_SDE_ROTATOR */
 
 struct dma_buf_attachment *sde_smmu_dma_buf_attach(
 		struct dma_buf *dma_buf, struct device *dev, int domain);