Message ID | 20201108223738.16535-1-rikard.falkeborn@gmail.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | drm/msm: dsi: Constify dsi_host_ops | expand |
On Sun, Nov 08, 2020 at 11:37:38PM +0100, Rikard Falkeborn 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. > > Signed-off-by: Rikard Falkeborn <rikard.falkeborn@gmail.com> Reviewed-by: Sam Ravnborg <sam@ravnborg.org> With this patch all struct mipi_dsi_host_ops are const - good. I expect the msm folks to pick it up. Sam
diff --git a/drivers/gpu/drm/msm/dsi/dsi_host.c b/drivers/gpu/drm/msm/dsi/dsi_host.c index 198db8d4cf3d..ab281cba0f08 100644 --- a/drivers/gpu/drm/msm/dsi/dsi_host.c +++ b/drivers/gpu/drm/msm/dsi/dsi_host.c @@ -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,
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. Signed-off-by: Rikard Falkeborn <rikard.falkeborn@gmail.com> --- drivers/gpu/drm/msm/dsi/dsi_host.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)