* [PATCH] drm/exynos: make pointer to const data const type
@ 2020-04-26 9:01 Bernard Zhao
2020-05-07 3:09 ` Bernard
0 siblings, 1 reply; 2+ messages in thread
From: Bernard Zhao @ 2020-04-26 9:01 UTC (permalink / raw)
To: Inki Dae, Joonyoung Shim, Seung-Woo Kim, Kyungmin Park,
David Airlie, Daniel Vetter, Kukjin Kim, Krzysztof Kozlowski,
dri-devel, linux-arm-kernel, linux-samsung-soc, linux-kernel
Cc: opensource.kernel, Bernard Zhao
Maybe keep pointer which points to global const string data
in const type is better, make sure not change const data.
Signed-off-by: Bernard Zhao <bernard@vivo.com>
---
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(-)
diff --git a/drivers/gpu/drm/exynos/exynos_drm_dsi.c b/drivers/gpu/drm/exynos/exynos_drm_dsi.c
index e080aa92338c..f60d99c85ac9 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_dsi.c
+++ b/drivers/gpu/drm/exynos/exynos_drm_dsi.c
@@ -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" };
diff --git a/drivers/gpu/drm/exynos/exynos_drm_mic.c b/drivers/gpu/drm/exynos/exynos_drm_mic.c
index f41d75923557..a86abc173605 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_mic.c
+++ b/drivers/gpu/drm/exynos/exynos_drm_mic.c
@@ -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);
--
2.26.2
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re:[PATCH] drm/exynos: make pointer to const data const type
2020-04-26 9:01 [PATCH] drm/exynos: make pointer to const data const type Bernard Zhao
@ 2020-05-07 3:09 ` Bernard
0 siblings, 0 replies; 2+ messages in thread
From: Bernard @ 2020-05-07 3:09 UTC (permalink / raw)
To: Bernard Zhao
Cc: Inki Dae, Joonyoung Shim, Seung-Woo Kim, Kyungmin Park,
David Airlie, Daniel Vetter, Kukjin Kim, Krzysztof Kozlowski,
dri-devel, linux-arm-kernel, linux-samsung-soc, linux-kernel,
opensource.kernel
From: Bernard Zhao <bernard@vivo.com>
Date: 2020-04-26 17:01:42
To: Inki Dae <inki.dae@samsung.com>,Joonyoung Shim <jy0922.shim@samsung.com>,Seung-Woo Kim <sw0312.kim@samsung.com>,Kyungmin Park <kyungmin.park@samsung.com>,David Airlie <airlied@linux.ie>,Daniel Vetter <daniel@ffwll.ch>,Kukjin Kim <kgene@kernel.org>,Krzysztof Kozlowski <krzk@kernel.org>,dri-devel@lists.freedesktop.org,linux-arm-kernel@lists.infradead.org,linux-samsung-soc@vger.kernel.org,linux-kernel@vger.kernel.org
Cc: opensource.kernel@vivo.com,Bernard Zhao <bernard@vivo.com>
Subject: [PATCH] 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.
>
>Signed-off-by: Bernard Zhao <bernard@vivo.com>
>---
> 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(-)
>
>diff --git a/drivers/gpu/drm/exynos/exynos_drm_dsi.c b/drivers/gpu/drm/exynos/exynos_drm_dsi.c
>index e080aa92338c..f60d99c85ac9 100644
>--- a/drivers/gpu/drm/exynos/exynos_drm_dsi.c
>+++ b/drivers/gpu/drm/exynos/exynos_drm_dsi.c
>@@ -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" };
>
>diff --git a/drivers/gpu/drm/exynos/exynos_drm_mic.c b/drivers/gpu/drm/exynos/exynos_drm_mic.c
>index f41d75923557..a86abc173605 100644
>--- a/drivers/gpu/drm/exynos/exynos_drm_mic.c
>+++ b/drivers/gpu/drm/exynos/exynos_drm_mic.c
>@@ -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);
>
>--
>2.26.2
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2020-05-07 3:10 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-04-26 9:01 [PATCH] drm/exynos: make pointer to const data const type Bernard Zhao
2020-05-07 3:09 ` Bernard
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).