diff mbox series

[1/2] remoteproc: ingenic: Constify ingenic_rproc_ops

Message ID 20201107233630.9728-2-rikard.falkeborn@gmail.com (mailing list archive)
State Accepted
Commit bb7eda7eddf1f8002e00a5147aff91fad8caf2d5
Headers show
Series remoteproc: Constify static struct rproc_ops | expand

Commit Message

Rikard Falkeborn Nov. 7, 2020, 11:36 p.m. UTC
The only usage of ingenic_rproc_ops is to pass its address to
devm_rproc_alloc(), which accepts 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/remoteproc/ingenic_rproc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Paul Cercueil Nov. 9, 2020, 10:47 p.m. UTC | #1
Hi,

Le dim. 8 nov. 2020 à 0:36, Rikard Falkeborn 
<rikard.falkeborn@gmail.com> a écrit :
> The only usage of ingenic_rproc_ops is to pass its address to
> devm_rproc_alloc(), which accepts 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>

Acked-by: Paul Cercueil <paul@crapouillou.net>

Cheers,
-Paul

> ---
>  drivers/remoteproc/ingenic_rproc.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/remoteproc/ingenic_rproc.c 
> b/drivers/remoteproc/ingenic_rproc.c
> index 1c2b21a5d178..26e19e6143b7 100644
> --- a/drivers/remoteproc/ingenic_rproc.c
> +++ b/drivers/remoteproc/ingenic_rproc.c
> @@ -135,7 +135,7 @@ static void *ingenic_rproc_da_to_va(struct rproc 
> *rproc, u64 da, size_t len)
>  	return (__force void *)va;
>  }
> 
> -static struct rproc_ops ingenic_rproc_ops = {
> +static const struct rproc_ops ingenic_rproc_ops = {
>  	.prepare = ingenic_rproc_prepare,
>  	.unprepare = ingenic_rproc_unprepare,
>  	.start = ingenic_rproc_start,
> --
> 2.29.2
>
diff mbox series

Patch

diff --git a/drivers/remoteproc/ingenic_rproc.c b/drivers/remoteproc/ingenic_rproc.c
index 1c2b21a5d178..26e19e6143b7 100644
--- a/drivers/remoteproc/ingenic_rproc.c
+++ b/drivers/remoteproc/ingenic_rproc.c
@@ -135,7 +135,7 @@  static void *ingenic_rproc_da_to_va(struct rproc *rproc, u64 da, size_t len)
 	return (__force void *)va;
 }
 
-static struct rproc_ops ingenic_rproc_ops = {
+static const struct rproc_ops ingenic_rproc_ops = {
 	.prepare = ingenic_rproc_prepare,
 	.unprepare = ingenic_rproc_unprepare,
 	.start = ingenic_rproc_start,