Skip to content

Commit 54f7c85

Browse files
Vamsi Krishna Gattupalligregkh
authored andcommitted
misc: fastrpc: Add helper function to get list and page
Add helper functions to get invoke buffer and page start pointers. Signed-off-by: Vamsi Krishna Gattupalli <[email protected]> Signed-off-by: Srinivas Kandagatla <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent e90d911 commit 54f7c85

File tree

1 file changed

+12
-3
lines changed

1 file changed

+12
-3
lines changed

drivers/misc/fastrpc.c

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -833,6 +833,16 @@ static int fastrpc_create_maps(struct fastrpc_invoke_ctx *ctx)
833833
return 0;
834834
}
835835

836+
static struct fastrpc_invoke_buf *fastrpc_invoke_buf_start(union fastrpc_remote_arg *pra, int len)
837+
{
838+
return (struct fastrpc_invoke_buf *)(&pra[len]);
839+
}
840+
841+
static struct fastrpc_phy_page *fastrpc_phy_page_start(struct fastrpc_invoke_buf *buf, int len)
842+
{
843+
return (struct fastrpc_phy_page *)(&buf[len]);
844+
}
845+
836846
static int fastrpc_get_args(u32 kernel, struct fastrpc_invoke_ctx *ctx)
837847
{
838848
struct device *dev = ctx->fl->sctx->dev;
@@ -860,9 +870,8 @@ static int fastrpc_get_args(u32 kernel, struct fastrpc_invoke_ctx *ctx)
860870
return err;
861871

862872
rpra = ctx->buf->virt;
863-
list = ctx->buf->virt + ctx->nscalars * sizeof(*rpra);
864-
pages = ctx->buf->virt + ctx->nscalars * (sizeof(*list) +
865-
sizeof(*rpra));
873+
list = fastrpc_invoke_buf_start(rpra, ctx->nscalars);
874+
pages = fastrpc_phy_page_start(list, ctx->nscalars);
866875
args = (uintptr_t)ctx->buf->virt + metalen;
867876
rlen = pkt_size - metalen;
868877
ctx->rpra = rpra;

0 commit comments

Comments
 (0)