linux-remoteproc.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/2] remoteproc: Constify static struct rproc_ops
@ 2020-11-07 23:36 Rikard Falkeborn
  2020-11-07 23:36 ` [PATCH 1/2] remoteproc: ingenic: Constify ingenic_rproc_ops Rikard Falkeborn
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Rikard Falkeborn @ 2020-11-07 23:36 UTC (permalink / raw)
  To: Ohad Ben-Cohen, Bjorn Andersson
  Cc: Paul Cercueil, Maxime Coquelin, Alexandre Torgue,
	linux-remoteproc, linux-kernel, linux-stm32, linux-arm-kernel,
	Rikard Falkeborn

Constify two static struct rproc_ops which are never modified. These two
changes makes all static instances of rproc_ops in the kernel const.

Rikard Falkeborn (2):
  remoteproc: ingenic: Constify ingenic_rproc_ops
  remoteproc: stm32: Constify st_rproc_ops

 drivers/remoteproc/ingenic_rproc.c | 2 +-
 drivers/remoteproc/stm32_rproc.c   | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

-- 
2.29.2


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH 1/2] remoteproc: ingenic: Constify ingenic_rproc_ops
  2020-11-07 23:36 [PATCH 0/2] remoteproc: Constify static struct rproc_ops Rikard Falkeborn
@ 2020-11-07 23:36 ` Rikard Falkeborn
  2020-11-09 22:47   ` Paul Cercueil
  2020-11-07 23:36 ` [PATCH 2/2] remoteproc: stm32: Constify st_rproc_ops Rikard Falkeborn
  2020-11-18 14:30 ` [PATCH 0/2] remoteproc: Constify static struct rproc_ops patchwork-bot+linux-remoteproc
  2 siblings, 1 reply; 6+ messages in thread
From: Rikard Falkeborn @ 2020-11-07 23:36 UTC (permalink / raw)
  To: Ohad Ben-Cohen, Bjorn Andersson
  Cc: Paul Cercueil, Maxime Coquelin, Alexandre Torgue,
	linux-remoteproc, linux-kernel, linux-stm32, linux-arm-kernel,
	Rikard Falkeborn

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(-)

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


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH 2/2] remoteproc: stm32: Constify st_rproc_ops
  2020-11-07 23:36 [PATCH 0/2] remoteproc: Constify static struct rproc_ops Rikard Falkeborn
  2020-11-07 23:36 ` [PATCH 1/2] remoteproc: ingenic: Constify ingenic_rproc_ops Rikard Falkeborn
@ 2020-11-07 23:36 ` Rikard Falkeborn
  2020-11-09 13:49   ` [Linux-stm32] " Arnaud POULIQUEN
  2020-11-18 14:30 ` [PATCH 0/2] remoteproc: Constify static struct rproc_ops patchwork-bot+linux-remoteproc
  2 siblings, 1 reply; 6+ messages in thread
From: Rikard Falkeborn @ 2020-11-07 23:36 UTC (permalink / raw)
  To: Ohad Ben-Cohen, Bjorn Andersson
  Cc: Paul Cercueil, Maxime Coquelin, Alexandre Torgue,
	linux-remoteproc, linux-kernel, linux-stm32, linux-arm-kernel,
	Rikard Falkeborn

The only usage of st_rproc_ops is to pass its address to 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/stm32_rproc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/remoteproc/stm32_rproc.c b/drivers/remoteproc/stm32_rproc.c
index d2414cc1d90d..a180aeae9675 100644
--- a/drivers/remoteproc/stm32_rproc.c
+++ b/drivers/remoteproc/stm32_rproc.c
@@ -541,7 +541,7 @@ static void stm32_rproc_kick(struct rproc *rproc, int vqid)
 	}
 }
 
-static struct rproc_ops st_rproc_ops = {
+static const struct rproc_ops st_rproc_ops = {
 	.start		= stm32_rproc_start,
 	.stop		= stm32_rproc_stop,
 	.attach		= stm32_rproc_attach,
-- 
2.29.2


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [Linux-stm32] [PATCH 2/2] remoteproc: stm32: Constify st_rproc_ops
  2020-11-07 23:36 ` [PATCH 2/2] remoteproc: stm32: Constify st_rproc_ops Rikard Falkeborn
@ 2020-11-09 13:49   ` Arnaud POULIQUEN
  0 siblings, 0 replies; 6+ messages in thread
From: Arnaud POULIQUEN @ 2020-11-09 13:49 UTC (permalink / raw)
  To: Rikard Falkeborn, Ohad Ben-Cohen, Bjorn Andersson
  Cc: linux-remoteproc, linux-kernel, Paul Cercueil, Maxime Coquelin,
	linux-stm32, linux-arm-kernel

Hi Rikard,

On 11/8/20 12:36 AM, Rikard Falkeborn wrote:
> The only usage of st_rproc_ops is to pass its address to 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/stm32_rproc.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/remoteproc/stm32_rproc.c b/drivers/remoteproc/stm32_rproc.c
> index d2414cc1d90d..a180aeae9675 100644
> --- a/drivers/remoteproc/stm32_rproc.c
> +++ b/drivers/remoteproc/stm32_rproc.c
> @@ -541,7 +541,7 @@ static void stm32_rproc_kick(struct rproc *rproc, int vqid)
>  	}
>  }
>  
> -static struct rproc_ops st_rproc_ops = {
> +static const struct rproc_ops st_rproc_ops = {
>  	.start		= stm32_rproc_start,
>  	.stop		= stm32_rproc_stop,
>  	.attach		= stm32_rproc_attach,
> 

acked-by: Arnaud Pouliquen <arnaud.pouliquen@st.com>

Thanks,
Arnaud

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH 1/2] remoteproc: ingenic: Constify ingenic_rproc_ops
  2020-11-07 23:36 ` [PATCH 1/2] remoteproc: ingenic: Constify ingenic_rproc_ops Rikard Falkeborn
@ 2020-11-09 22:47   ` Paul Cercueil
  0 siblings, 0 replies; 6+ messages in thread
From: Paul Cercueil @ 2020-11-09 22:47 UTC (permalink / raw)
  To: Rikard Falkeborn
  Cc: Ohad Ben-Cohen, Bjorn Andersson, Maxime Coquelin,
	Alexandre Torgue, linux-remoteproc, linux-kernel, linux-stm32,
	linux-arm-kernel

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
> 



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH 0/2] remoteproc: Constify static struct rproc_ops
  2020-11-07 23:36 [PATCH 0/2] remoteproc: Constify static struct rproc_ops Rikard Falkeborn
  2020-11-07 23:36 ` [PATCH 1/2] remoteproc: ingenic: Constify ingenic_rproc_ops Rikard Falkeborn
  2020-11-07 23:36 ` [PATCH 2/2] remoteproc: stm32: Constify st_rproc_ops Rikard Falkeborn
@ 2020-11-18 14:30 ` patchwork-bot+linux-remoteproc
  2 siblings, 0 replies; 6+ messages in thread
From: patchwork-bot+linux-remoteproc @ 2020-11-18 14:30 UTC (permalink / raw)
  To: Rikard Falkeborn; +Cc: linux-remoteproc

Hello:

This series was applied to andersson/remoteproc.git (refs/heads/for-next):

On Sun,  8 Nov 2020 00:36:28 +0100 you wrote:
> Constify two static struct rproc_ops which are never modified. These two
> changes makes all static instances of rproc_ops in the kernel const.
> 
> Rikard Falkeborn (2):
>   remoteproc: ingenic: Constify ingenic_rproc_ops
>   remoteproc: stm32: Constify st_rproc_ops
> 
> [...]

Here is the summary with links:
  - [1/2] remoteproc: ingenic: Constify ingenic_rproc_ops
    https://git.kernel.org/andersson/remoteproc/c/bb7eda7eddf1
  - [2/2] remoteproc: stm32: Constify st_rproc_ops
    https://git.kernel.org/andersson/remoteproc/c/0eee3d28ff65

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



^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2020-11-18 14:30 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-11-07 23:36 [PATCH 0/2] remoteproc: Constify static struct rproc_ops Rikard Falkeborn
2020-11-07 23:36 ` [PATCH 1/2] remoteproc: ingenic: Constify ingenic_rproc_ops Rikard Falkeborn
2020-11-09 22:47   ` Paul Cercueil
2020-11-07 23:36 ` [PATCH 2/2] remoteproc: stm32: Constify st_rproc_ops Rikard Falkeborn
2020-11-09 13:49   ` [Linux-stm32] " Arnaud POULIQUEN
2020-11-18 14:30 ` [PATCH 0/2] remoteproc: Constify static struct rproc_ops patchwork-bot+linux-remoteproc

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).