From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 070BB443E3F for ; Wed, 29 Jul 2026 09:44:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785318246; cv=none; b=UVp2b7RFpP1s6NNeGgqkynKJBn7C1uz+euQRsle7aU45eGkRuYkEpP/zVRXpq4PsJLdT/D2D1EjjJMb4E6T7C3nbd2v5aIKaZlB61lQE2PRn65rS8EpqEW2kADJn8mRbpky5hVSJ7WOcEW+lMR14/fPaatn9jNWeeLRdsfPjNxc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785318246; c=relaxed/simple; bh=i9RusI0cV0CShBDLqybXlCylXj/IowocLin1hXIzmlI=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=RgjB0dGvUpx2sNDheA6VUDTQGTFtor6XyYksVhSry0QC0Vn5sJS7+d3BkVW7Wd9+RC55AkyB6w8qFfldH5T0BRkcxBYIiSE4kOlJ4C4SuL9TqTknRNvnRZXkI1xgSrM9CNNdMAQOwYDizp4lyH/W8obKj1abnl9XjFR6KOJAw58= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=grScfzbs; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="grScfzbs" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 847891F00A3D; Wed, 29 Jul 2026 09:44:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1785318244; bh=waLyX7zDuKdQ9yt2/QlKR4YfyVnTJ8/UTZhSX6ERalQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=grScfzbslFPkitApmc/pCY/9c6xp5RT+1bc0d5DjJ8onJBEz97Ys8P9qIXXpbMDxb zY8SPpYJSfakFjsCemogmYUJtPVziVlx3ywRE75smi9DY8T+j5xiOOuh9jcvbYGl1W YkhwgEZ0KSQ6CeUbfQhp5p2Telt2jV7mob/GvfIAkklTmIiQH/bx0AagZkoFOPbWrI 5JkZOWvqRHcNShlfj79JzEbpuR/ppkIcmR/DEbjx4MIWbBSdM6Scrb/+7m/1o7VX9D p6BJkU53XFGr+OGyxnju9TjLNo3KqaRLiJh0CyiraLd+FjEWdG6r+kDuqHUV0wXtSl exc9WOFDzSwRw== From: srini@kernel.org To: gregkh@linuxfoundation.org Cc: linux-kernel@vger.kernel.org, Ekansh Gupta , Dmitry Baryshkov , Srinivas Kandagatla Subject: [PATCH 04/10] misc: fastrpc: Move fdlist to invoke context structure Date: Wed, 29 Jul 2026 10:43:46 +0100 Message-ID: <20260729094352.111065-5-srini@kernel.org> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260729094352.111065-1-srini@kernel.org> References: <20260729094352.111065-1-srini@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit From: Ekansh Gupta The fdlist is currently part of the meta buffer which is set during fastrpc_get_args(), this fdlist is getting recalculated during fastrpc_put_args(). Move fdlist to the invoke context structure to improve maintainability and reduce redundancy. This centralizes its handling and simplifies meta buffer preparation and reading logic. Reviewed-by: Dmitry Baryshkov Signed-off-by: Ekansh Gupta Signed-off-by: Srinivas Kandagatla --- drivers/misc/fastrpc.c | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/drivers/misc/fastrpc.c b/drivers/misc/fastrpc.c index 32da4664de58..885ba7d1bff5 100644 --- a/drivers/misc/fastrpc.c +++ b/drivers/misc/fastrpc.c @@ -233,6 +233,7 @@ struct fastrpc_invoke_ctx { int pid; int client_id; u32 sc; + u64 *fdlist; u32 *crc; u64 ctxid; u64 msg_sz; @@ -1063,6 +1064,7 @@ static int fastrpc_get_args(u32 kernel, struct fastrpc_invoke_ctx *ctx) rpra = ctx->buf->virt; list = fastrpc_invoke_buf_start(rpra, ctx->nscalars); pages = fastrpc_phy_page_start(list, ctx->nscalars); + ctx->fdlist = (u64 *)(pages + ctx->nscalars); args = (uintptr_t)ctx->buf->virt + metalen; rlen = pkt_size - metalen; ctx->rpra = rpra; @@ -1165,18 +1167,11 @@ static int fastrpc_put_args(struct fastrpc_invoke_ctx *ctx, union fastrpc_remote_arg *rpra = ctx->rpra; struct fastrpc_user *fl = ctx->fl; struct fastrpc_map *mmap = NULL; - struct fastrpc_invoke_buf *list; - struct fastrpc_phy_page *pages; - u64 *fdlist; - int i, inbufs, outbufs, handles; + u64 *fdlist = ctx->fdlist; + int i, inbufs; int ret = 0; inbufs = REMOTE_SCALARS_INBUFS(ctx->sc); - outbufs = REMOTE_SCALARS_OUTBUFS(ctx->sc); - handles = REMOTE_SCALARS_INHANDLES(ctx->sc) + REMOTE_SCALARS_OUTHANDLES(ctx->sc); - list = fastrpc_invoke_buf_start(rpra, ctx->nscalars); - pages = fastrpc_phy_page_start(list, ctx->nscalars); - fdlist = (uint64_t *)(pages + inbufs + outbufs + handles); for (i = inbufs; i < ctx->nbufs; ++i) { if (!ctx->maps[i]) { -- 2.53.0