[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20220126135304.16340-10-srinivas.kandagatla@linaro.org>
Date: Wed, 26 Jan 2022 13:53:01 +0000
From: Srinivas Kandagatla <srinivas.kandagatla@...aro.org>
To: robh+dt@...nel.org, gregkh@...uxfoundation.org
Cc: devicetree@...r.kernel.org, ekangupt@....qualcomm.com,
bkumar@....qualcomm.com, linux-kernel@...r.kernel.org,
srini@...nel.org, bjorn.andersson@...aro.org,
linux-arm-msm@...r.kernel.org,
Vamsi Krishna Gattupalli <quic_vgattupa@...cinc.com>,
Srinivas Kandagatla <srinivas.kandagatla@...aro.org>
Subject: [PATCH v3 09/12] misc: fastrpc: Add helper function to get list and page
From: Vamsi Krishna Gattupalli <quic_vgattupa@...cinc.com>
Add helper functions to get invoke buffer and page start pointers.
Signed-off-by: Vamsi Krishna Gattupalli <quic_vgattupa@...cinc.com>
Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@...aro.org>
---
drivers/misc/fastrpc.c | 15 ++++++++++++---
1 file changed, 12 insertions(+), 3 deletions(-)
diff --git a/drivers/misc/fastrpc.c b/drivers/misc/fastrpc.c
index 0090085bfbb9..1c1815bed2c2 100644
--- a/drivers/misc/fastrpc.c
+++ b/drivers/misc/fastrpc.c
@@ -832,6 +832,16 @@ static int fastrpc_create_maps(struct fastrpc_invoke_ctx *ctx)
return 0;
}
+static struct fastrpc_invoke_buf *fastrpc_invoke_buf_start(union fastrpc_remote_arg *pra, int len)
+{
+ return (struct fastrpc_invoke_buf *)(&pra[len]);
+}
+
+static struct fastrpc_phy_page *fastrpc_phy_page_start(struct fastrpc_invoke_buf *buf, int len)
+{
+ return (struct fastrpc_phy_page *)(&buf[len]);
+}
+
static int fastrpc_get_args(u32 kernel, struct fastrpc_invoke_ctx *ctx)
{
struct device *dev = ctx->fl->sctx->dev;
@@ -859,9 +869,8 @@ static int fastrpc_get_args(u32 kernel, struct fastrpc_invoke_ctx *ctx)
return err;
rpra = ctx->buf->virt;
- list = ctx->buf->virt + ctx->nscalars * sizeof(*rpra);
- pages = ctx->buf->virt + ctx->nscalars * (sizeof(*list) +
- sizeof(*rpra));
+ list = fastrpc_invoke_buf_start(rpra, ctx->nscalars);
+ pages = fastrpc_phy_page_start(list, ctx->nscalars);
args = (uintptr_t)ctx->buf->virt + metalen;
rlen = pkt_size - metalen;
ctx->rpra = rpra;
--
2.21.0
Powered by blists - more mailing lists