* [PATCH] drm: msm: hdmi: Constify static structs
@ 2021-09-20 21:20 Rikard Falkeborn
2021-10-01 17:25 ` Dmitry Baryshkov
0 siblings, 1 reply; 2+ messages in thread
From: Rikard Falkeborn @ 2021-09-20 21:20 UTC (permalink / raw)
To: Rob Clark, Sean Paul, David Airlie, Daniel Vetter
Cc: linux-arm-msm, dri-devel, freedreno, linux-kernel, Rikard Falkeborn
The only usage of hdmi_8996_pll_ops is to assign its address to the ops
field in the clk_init_data struct, and the only usage of pll_init is to
assign its address to the init field in the clk_hw struct, both which
are pointers to const. Make them const to allow the compiler to put them
in read-only memory.
Signed-off-by: Rikard Falkeborn <rikard.falkeborn@gmail.com>
---
drivers/gpu/drm/msm/hdmi/hdmi_phy_8996.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/gpu/drm/msm/hdmi/hdmi_phy_8996.c b/drivers/gpu/drm/msm/hdmi/hdmi_phy_8996.c
index a8f3b2cbfdc5..99c7853353fd 100644
--- a/drivers/gpu/drm/msm/hdmi/hdmi_phy_8996.c
+++ b/drivers/gpu/drm/msm/hdmi/hdmi_phy_8996.c
@@ -682,7 +682,7 @@ static int hdmi_8996_pll_is_enabled(struct clk_hw *hw)
return pll_locked;
}
-static struct clk_ops hdmi_8996_pll_ops = {
+static const struct clk_ops hdmi_8996_pll_ops = {
.set_rate = hdmi_8996_pll_set_clk_rate,
.round_rate = hdmi_8996_pll_round_rate,
.recalc_rate = hdmi_8996_pll_recalc_rate,
@@ -695,7 +695,7 @@ static const char * const hdmi_pll_parents[] = {
"xo",
};
-static struct clk_init_data pll_init = {
+static const struct clk_init_data pll_init = {
.name = "hdmipll",
.ops = &hdmi_8996_pll_ops,
.parent_names = hdmi_pll_parents,
--
2.33.0
^ permalink raw reply [flat|nested] 2+ messages in thread* Re: [PATCH] drm: msm: hdmi: Constify static structs
2021-09-20 21:20 [PATCH] drm: msm: hdmi: Constify static structs Rikard Falkeborn
@ 2021-10-01 17:25 ` Dmitry Baryshkov
0 siblings, 0 replies; 2+ messages in thread
From: Dmitry Baryshkov @ 2021-10-01 17:25 UTC (permalink / raw)
To: Rikard Falkeborn, Rob Clark, Sean Paul, David Airlie, Daniel Vetter
Cc: linux-arm-msm, dri-devel, freedreno, linux-kernel
On 21/09/2021 00:20, Rikard Falkeborn wrote:
> The only usage of hdmi_8996_pll_ops is to assign its address to the ops
> field in the clk_init_data struct, and the only usage of pll_init is to
> assign its address to the init field in the clk_hw struct, both which
> are pointers to const. Make them const to allow the compiler to put them
> in read-only memory.
>
> Signed-off-by: Rikard Falkeborn <rikard.falkeborn@gmail.com>
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
> ---
> drivers/gpu/drm/msm/hdmi/hdmi_phy_8996.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/msm/hdmi/hdmi_phy_8996.c b/drivers/gpu/drm/msm/hdmi/hdmi_phy_8996.c
> index a8f3b2cbfdc5..99c7853353fd 100644
> --- a/drivers/gpu/drm/msm/hdmi/hdmi_phy_8996.c
> +++ b/drivers/gpu/drm/msm/hdmi/hdmi_phy_8996.c
> @@ -682,7 +682,7 @@ static int hdmi_8996_pll_is_enabled(struct clk_hw *hw)
> return pll_locked;
> }
>
> -static struct clk_ops hdmi_8996_pll_ops = {
> +static const struct clk_ops hdmi_8996_pll_ops = {
> .set_rate = hdmi_8996_pll_set_clk_rate,
> .round_rate = hdmi_8996_pll_round_rate,
> .recalc_rate = hdmi_8996_pll_recalc_rate,
> @@ -695,7 +695,7 @@ static const char * const hdmi_pll_parents[] = {
> "xo",
> };
>
> -static struct clk_init_data pll_init = {
> +static const struct clk_init_data pll_init = {
> .name = "hdmipll",
> .ops = &hdmi_8996_pll_ops,
> .parent_names = hdmi_pll_parents,
>
--
With best wishes
Dmitry
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2021-10-01 17:25 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-09-20 21:20 [PATCH] drm: msm: hdmi: Constify static structs Rikard Falkeborn
2021-10-01 17:25 ` Dmitry Baryshkov
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®