Skip to contentSkip to conversation

remoteproc: fix argument 2 of rproc_mem_entry_init

PATCH Applied Ben Dooks (Codethink) 2 participants 2 messages Oct 17, 2019 – Nov 9, 2019 Remote processor (remoteproc)

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 remoteproc: fix argument 2 of rproc_mem_entry_init

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

---
Cc: Ohad Ben-Cohen <[email protected]>
Cc: Bjorn Andersson <[email protected]>
Cc: [email protected]
Cc: [email protected]

---
 drivers/remoteproc/remoteproc_core.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
drivers/remoteproc/remoteproc_core.c +3 -2
index 3c5fbbbfb0f1..943af836fa0f 100644
@@ -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) {
Signature · 1 line
2.23.0
#1 lore raw
Quoted 8 lines · Ben Dooks (Codethink)

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

Quoted 36 lines

---
Cc: Ohad Ben-Cohen <[email protected]>
Cc: Bjorn Andersson <[email protected]>
Cc: [email protected]
Cc: [email protected]

---
 drivers/remoteproc/remoteproc_core.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
drivers/remoteproc/remoteproc_core.c +3 -2
index 3c5fbbbfb0f1..943af836fa0f 100644
@@ -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) {
Signature · 1 line
2.23.0