LKML Archive on lore.kernel.org
 help / color / Atom feed
* [PATCH] remoteproc: fix argument 2 of rproc_mem_entry_init
@ 2019-10-17 11:59 Ben Dooks (Codethink)
  2019-11-09  1:21 ` Bjorn Andersson
  0 siblings, 1 reply; 2+ messages in thread
From: Ben Dooks (Codethink) @ 2019-10-17 11:59 UTC (permalink / raw)
  To: linux-kernel
  Cc: Ben Dooks (Codethink),
	Ohad Ben-Cohen, Bjorn Andersson, linux-remoteproc, linux-kernel

The rproc_mem_entry_init() call takes a pointer to a vm
as the second argument. The code is currently using a
plain 0 as "NULL". Change to using NULL to fix the
following sparse warnings:

drivers/remoteproc/remoteproc_core.c:339:49: warning: Using plain integer as NULL pointer
drivers/remoteproc/remoteproc_core.c:916:46: warning: Using plain integer as NULL pointer

Signed-off-by: Ben Dooks <ben.dooks@codethink.co.uk>
---
Cc: Ohad Ben-Cohen <ohad@wizery.com>
Cc: Bjorn Andersson <bjorn.andersson@linaro.org>
Cc: linux-remoteproc@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
---
 drivers/remoteproc/remoteproc_core.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/remoteproc/remoteproc_core.c b/drivers/remoteproc/remoteproc_core.c
index 3c5fbbbfb0f1..943af836fa0f 100644
--- a/drivers/remoteproc/remoteproc_core.c
+++ b/drivers/remoteproc/remoteproc_core.c
@@ -336,7 +336,8 @@ int rproc_alloc_vring(struct rproc_vdev *rvdev, int i)
 			return -ENOMEM;
 	} else {
 		/* Register carveout in in list */
-		mem = rproc_mem_entry_init(dev, 0, 0, size, rsc->vring[i].da,
+		mem = rproc_mem_entry_init(dev, NULL, 0,
+					   size, rsc->vring[i].da,
 					   rproc_alloc_carveout,
 					   rproc_release_carveout,
 					   "vdev%dvring%d",
@@ -913,7 +914,7 @@ static int rproc_handle_carveout(struct rproc *rproc,
 	}
 
 	/* Register carveout in in list */
-	carveout = rproc_mem_entry_init(dev, 0, 0, rsc->len, rsc->da,
+	carveout = rproc_mem_entry_init(dev, NULL, 0, rsc->len, rsc->da,
 					rproc_alloc_carveout,
 					rproc_release_carveout, rsc->name);
 	if (!carveout) {
-- 
2.23.0


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

* Re: [PATCH] remoteproc: fix argument 2 of rproc_mem_entry_init
  2019-10-17 11:59 [PATCH] remoteproc: fix argument 2 of rproc_mem_entry_init Ben Dooks (Codethink)
@ 2019-11-09  1:21 ` Bjorn Andersson
  0 siblings, 0 replies; 2+ messages in thread
From: Bjorn Andersson @ 2019-11-09  1:21 UTC (permalink / raw)
  To: Ben Dooks (Codethink)
  Cc: linux-kernel, Ohad Ben-Cohen, linux-remoteproc, linux-kernel

On Thu 17 Oct 04:59 PDT 2019, Ben Dooks (Codethink) wrote:

> The rproc_mem_entry_init() call takes a pointer to a vm
> as the second argument. The code is currently using a
> plain 0 as "NULL". Change to using NULL to fix the
> following sparse warnings:
> 
> drivers/remoteproc/remoteproc_core.c:339:49: warning: Using plain integer as NULL pointer
> drivers/remoteproc/remoteproc_core.c:916:46: warning: Using plain integer as NULL pointer
> 

Applied, thanks

> Signed-off-by: Ben Dooks <ben.dooks@codethink.co.uk>
> ---
> Cc: Ohad Ben-Cohen <ohad@wizery.com>
> Cc: Bjorn Andersson <bjorn.andersson@linaro.org>
> Cc: linux-remoteproc@vger.kernel.org
> Cc: linux-kernel@vger.kernel.org
> ---
>  drivers/remoteproc/remoteproc_core.c | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/remoteproc/remoteproc_core.c b/drivers/remoteproc/remoteproc_core.c
> index 3c5fbbbfb0f1..943af836fa0f 100644
> --- a/drivers/remoteproc/remoteproc_core.c
> +++ b/drivers/remoteproc/remoteproc_core.c
> @@ -336,7 +336,8 @@ int rproc_alloc_vring(struct rproc_vdev *rvdev, int i)
>  			return -ENOMEM;
>  	} else {
>  		/* Register carveout in in list */
> -		mem = rproc_mem_entry_init(dev, 0, 0, size, rsc->vring[i].da,
> +		mem = rproc_mem_entry_init(dev, NULL, 0,
> +					   size, rsc->vring[i].da,
>  					   rproc_alloc_carveout,
>  					   rproc_release_carveout,
>  					   "vdev%dvring%d",
> @@ -913,7 +914,7 @@ static int rproc_handle_carveout(struct rproc *rproc,
>  	}
>  
>  	/* Register carveout in in list */
> -	carveout = rproc_mem_entry_init(dev, 0, 0, rsc->len, rsc->da,
> +	carveout = rproc_mem_entry_init(dev, NULL, 0, rsc->len, rsc->da,
>  					rproc_alloc_carveout,
>  					rproc_release_carveout, rsc->name);
>  	if (!carveout) {
> -- 
> 2.23.0
> 

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

end of thread, back to index

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-10-17 11:59 [PATCH] remoteproc: fix argument 2 of rproc_mem_entry_init Ben Dooks (Codethink)
2019-11-09  1:21 ` Bjorn Andersson

LKML Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/lkml/0 lkml/git/0.git
	git clone --mirror https://lore.kernel.org/lkml/1 lkml/git/1.git
	git clone --mirror https://lore.kernel.org/lkml/2 lkml/git/2.git
	git clone --mirror https://lore.kernel.org/lkml/3 lkml/git/3.git
	git clone --mirror https://lore.kernel.org/lkml/4 lkml/git/4.git
	git clone --mirror https://lore.kernel.org/lkml/5 lkml/git/5.git
	git clone --mirror https://lore.kernel.org/lkml/6 lkml/git/6.git
	git clone --mirror https://lore.kernel.org/lkml/7 lkml/git/7.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 lkml lkml/ https://lore.kernel.org/lkml \
		linux-kernel@vger.kernel.org
	public-inbox-index lkml

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-kernel


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git