Skip to contentSkip to conversation

drm/exynos: make pointer to const data const type

PATCH In review Bernard Zhao 1 participant 2 messages Apr 26, 2020 – May 7, 2020

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm/exynos: make pointer to const data const type

Maybe keep pointer which points to global const string data in const type is better, make sure not change const data.

---
 drivers/gpu/drm/exynos/exynos_drm_dsi.c | 2 +-
 drivers/gpu/drm/exynos/exynos_drm_mic.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/exynos/exynos_drm_dsi.c +1 -1
index e080aa92338c..f60d99c85ac9 100644
@@ -211,7 +211,7 @@
 
 #define OLD_SCLK_MIPI_CLK_NAME "pll_clk"
 
-static char *clk_names[5] = { "bus_clk", "sclk_mipi",
+static const char *const clk_names[5] = { "bus_clk", "sclk_mipi",
 	"phyclk_mipidphy0_bitclkdiv8", "phyclk_mipidphy0_rxclkesc0",
 	"sclk_rgb_vclk_to_dsim0" };
 
drivers/gpu/drm/exynos/exynos_drm_mic.c +1 -1
index f41d75923557..a86abc173605 100644
@@ -88,7 +88,7 @@
 
 #define MIC_BS_SIZE_2D(x)	((x) & 0x3fff)
 
-static char *clk_names[] = { "pclk_mic0", "sclk_rgb_vclk_to_mic0" };
+static const char *const clk_names[] = { "pclk_mic0", "sclk_rgb_vclk_to_mic0" };
 #define NUM_CLKS		ARRAY_SIZE(clk_names)
 static DEFINE_MUTEX(mic_mutex);
 
Signature · 1 line
2.26.2
author
#1 lore raw

From: Bernard Zhao <[email protected]>
Date: 2020-04-26 17:01:42
To: Inki Dae <[email protected]>,Joonyoung Shim <[email protected]>,Seung-Woo Kim <[email protected]>,Kyungmin Park <[email protected]>,David Airlie <[email protected]>,Daniel Vetter <[email protected]>,Kukjin Kim <[email protected]>,Krzysztof Kozlowski <[email protected]>,[email protected],[email protected],[email protected],[email protected]
Cc: [email protected],Bernard Zhao <[email protected]>
Subject: [PATCH] drm/exynos: make pointer to const data const type>Maybe keep pointer which points to global const string data

Quoted 37 lines

in const type is better, make sure not change const data.

---
drivers/gpu/drm/exynos/exynos_drm_dsi.c | 2 +-
drivers/gpu/drm/exynos/exynos_drm_mic.c | 2 +-

2 files changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/exynos/exynos_drm_dsi.c +1 -1
index e080aa92338c..f60d99c85ac9 100644
@@ -211,7 +211,7 @@
 
 #define OLD_SCLK_MIPI_CLK_NAME "pll_clk"
 
-static char *clk_names[5] = { "bus_clk", "sclk_mipi",
+static const char *const clk_names[5] = { "bus_clk", "sclk_mipi",
 	"phyclk_mipidphy0_bitclkdiv8", "phyclk_mipidphy0_rxclkesc0",
 	"sclk_rgb_vclk_to_dsim0" };
 
drivers/gpu/drm/exynos/exynos_drm_mic.c +1 -1
index f41d75923557..a86abc173605 100644
@@ -88,7 +88,7 @@
 
 #define MIC_BS_SIZE_2D(x)	((x) & 0x3fff)
 
-static char *clk_names[] = { "pclk_mic0", "sclk_rgb_vclk_to_mic0" };
+static const char *const clk_names[] = { "pclk_mic0", "sclk_rgb_vclk_to_mic0" };
 #define NUM_CLKS		ARRAY_SIZE(clk_names)
 static DEFINE_MUTEX(mic_mutex);
 
Signature · 1 line
2.26.2