Skip to contentSkip to conversation

drm/msm: dsi: Constify dsi_host_ops

PATCH Applied Rikard Falkeborn 3 participants 3 messages Nov 8, 2020 – Dec 29, 2020

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

PATCH 1/1 drm/msm: dsi: Constify dsi_host_ops

The only usage of dsi_host_ops is to assign its address to the ops field in the mipi_dsi_host struct, which is a const pointer. Make it const to allow the compiler to put it in read-only memory.

---
 drivers/gpu/drm/msm/dsi/dsi_host.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/msm/dsi/dsi_host.c +1 -1
index 198db8d4cf3d..ab281cba0f08 100644
@@ -1657,7 +1657,7 @@ static ssize_t dsi_host_transfer(struct mipi_dsi_host *host,
 	return ret;
 }
 
-static struct mipi_dsi_host_ops dsi_host_ops = {
+static const struct mipi_dsi_host_ops dsi_host_ops = {
 	.attach = dsi_host_attach,
 	.detach = dsi_host_detach,
 	.transfer = dsi_host_transfer,
Signature · 1 line
2.29.2
Reviewed-by on v1 1/1
#1 lore raw
Quoted 5 lines · Rikard Falkeborn

The only usage of dsi_host_ops is to assign its address to the ops field in the mipi_dsi_host struct, which is a const pointer. Make it const to allow the compiler to put it in read-only memory.

With this patch all struct mipi_dsi_host_ops are const - good. I expect the msm folks to pick it up.

Sam

#2 lore raw
In reply to Rikard Falkeborn
This patch was applied to qcom/linux.git (refs/heads/for-next):

Hello:

This patch was applied to qcom/linux.git (refs/heads/for-next):

Quoted 8 lines · On Sun, 8 Nov 2020 23:37:38 +0100 you wrote:

The only usage of dsi_host_ops is to assign its address to the ops field in the mipi_dsi_host struct, which is a const pointer. Make it const to allow the compiler to put it in read-only memory.

---
 drivers/gpu/drm/msm/dsi/dsi_host.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Here is the summary with links:
- drm/msm: dsi: Constify dsi_host_ops

    https://git.kernel.org/qcom/c/8b6947a81e56

You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html