From: Markus Elfring <Markus.Elfring@web.de>
To: dri-devel@lists.freedesktop.org, linux-arm-msm@vger.kernel.org,
Carl Vanderlip <carl.vanderlip@oss.qualcomm.com>,
Jacek Lawrynowicz <jacek.lawrynowicz@linux.intel.com>,
Jeff Hugo <jeff.hugo@oss.qualcomm.com>,
Oded Gabbay <ogabbay@kernel.org>,
Pranjal Ramajor Asha Kanojiya <quic_pkanojiy@quicinc.com>,
Stanislaw Gruszka <stanislaw.gruszka@linux.intel.com>
Cc: LKML <linux-kernel@vger.kernel.org>,
kernel-janitors@vger.kernel.org,
Miaoqian Lin <linmq006@gmail.com>
Subject: [PATCH] accel/qaic: Use pointer from memcpy() call for assignment in copy_partial_exec_reqs()
Date: Fri, 31 Oct 2025 11:34:54 +0100 [thread overview]
Message-ID: <d154d3c4-dd3e-488d-862f-5361867a70f1@web.de> (raw)
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Fri, 31 Oct 2025 11:26:33 +0100
A pointer was assigned to a variable. The same pointer was used for
the destination parameter of a memcpy() call.
This function is documented in the way that the same value is returned.
Thus convert two separate statements into a direct variable assignment for
the return value from a memory copy action.
The source code was transformed by using the Coccinelle software.
Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
drivers/accel/qaic/qaic_data.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/accel/qaic/qaic_data.c b/drivers/accel/qaic/qaic_data.c
index fa723a2bdfa9..c1b315d1689c 100644
--- a/drivers/accel/qaic/qaic_data.c
+++ b/drivers/accel/qaic/qaic_data.c
@@ -1171,8 +1171,8 @@ static inline int copy_partial_exec_reqs(struct qaic_device *qdev, struct bo_sli
* Copy over the last entry. Here we need to adjust len to the left over
* size, and set src and dst to the entry it is copied to.
*/
- last_req = fifo_at(dbc->req_q_base, (tail + first_n) % dbc->nelem);
- memcpy(last_req, reqs + slice->nents - 1, sizeof(*reqs));
+ last_req = memcpy(fifo_at(dbc->req_q_base, (tail + first_n) % dbc->nelem),
+ reqs + slice->nents - 1, sizeof(*reqs));
/*
* last_bytes holds size of a DMA segment, maximum DMA segment size is
--
2.51.1
next reply other threads:[~2025-10-31 10:35 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-10-31 10:34 Markus Elfring [this message]
2025-10-31 15:30 ` Jeff Hugo
2025-10-31 15:34 ` Markus Elfring
2025-10-31 16:10 ` Jeff Hugo
2025-10-31 16:35 ` Markus Elfring
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=d154d3c4-dd3e-488d-862f-5361867a70f1@web.de \
--to=markus.elfring@web.de \
--cc=carl.vanderlip@oss.qualcomm.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=jacek.lawrynowicz@linux.intel.com \
--cc=jeff.hugo@oss.qualcomm.com \
--cc=kernel-janitors@vger.kernel.org \
--cc=linmq006@gmail.com \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=ogabbay@kernel.org \
--cc=quic_pkanojiy@quicinc.com \
--cc=stanislaw.gruszka@linux.intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®