Skip to contentSkip to conversation

accel/qaic: Use pointer from memcpy() call for assignment in copy_partial_exec_reqs()

PATCH In review Markus Elfring 2 participants 5 messages Oct 31, 2025

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 accel/qaic: Use pointer from memcpy() call for assignment in copy_partial_exec_reqs()

From: Markus Elfring <[email protected]>
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.

---
 drivers/accel/qaic/qaic_data.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/accel/qaic/qaic_data.c +2 -2
index fa723a2bdfa9..c1b315d1689c 100644
@@ -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
Signature · 1 line
2.51.1
maintainer
#1 lore raw
Quoted 9 lines · Markus Elfring

From: Markus Elfring <[email protected]>
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.

Quoted 3 lines

The source code was transformed by using the Coccinelle software.

This does not match the address this patch was received from, therefore DCO does not appear to be satisfied. I cannot accept this.

Quoted 9 lines
---
  drivers/accel/qaic/qaic_data.c | 4 ++--
  1 file changed, 2 insertions(+), 2 deletions(-)
drivers/accel/qaic/qaic_data.c +0 -0
index fa723a2bdfa9..c1b315d1689c 100644

drivers/accel/qaic/qaic_data.c static inline int copy_partial_exec_reqs(struct qaic_device *qdev, struct bo_sli · line 1175

Quoted 7 lines
drivers/accel/qaic/qaic_data.c +2 -2
@@ -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));

The new version reads worse to me, so I do not consider this to be an improvement. This is not a critical path, so I doubt any performance increase that may exist outweighs the impact to readability.

-Jeff

#2 lore raw
Quoted 2 lines
Quoted 2 lines

From: Markus Elfring <[email protected]>
Date: Fri, 31 Oct 2025 11:26:33 +0100

…>> Signed-off-by: Markus Elfring <[email protected]>

Quoted 2 lines

This does not match the address this patch was received from, therefore DCO does not appear to be satisfied.  I cannot accept this.

I find such a change rejection questionable.
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/process/submitting-patches.rst?h=v6.18-rc3#n409

Regards,
Markus

maintainer
#3 lore raw
Quoted 8 lines · Markus Elfring
Quoted 2 lines
Quoted 2 lines

From: Markus Elfring <[email protected]>
Date: Fri, 31 Oct 2025 11:26:33 +0100

…>> Signed-off-by: Markus Elfring <[email protected]>

Quoted 2 lines

This does not match the address this patch was received from, therefore DCO does not appear to be satisfied.  I cannot accept this.

I find such a change rejection questionable.
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/process/submitting-patches.rst?h=v6.18-rc3#n409

I received this patch from "Markus Elfring <[email protected]>". There is no SOB from "Markus Elfring <[email protected]>" therefore "Markus Elfring <[email protected]>" has not followed the DCO.

The resolution to this is either the author and the SOB change to "Markus Elfring <[email protected]>" or "Markus Elfring <[email protected]>" adds a SOB at the end to show the path the patch took (reference the paragraph in the documentation you linked to, starting at line 449).

-Jeff

#4 lore raw
Quoted 11 lines
Quoted 9 lines
Quoted 6 lines
Quoted 4 lines

From: Markus Elfring <[email protected]>
Date: Fri, 31 Oct 2025 11:26:33 +0100
…

This does not match the address this patch was received from, therefore DCO does not appear to be satisfied.  I cannot accept this.

I find such a change rejection questionable.
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/process/submitting-patches.rst?h=v6.18-rc3#n409

I received this patch from "Markus Elfring <[email protected]>".

This can be fine.

Quoted 1 line

There is no SOB from "Markus Elfring <[email protected]>" therefore "Markus Elfring <[email protected]>" has not followed the DCO.

Are you aware how author information can be better preserved for patches?

Quoted 1 line

The resolution to this is either the author and the SOB change to "Markus Elfring <[email protected]>" or "Markus Elfring <[email protected]>" adds a SOB at the end to show the path the patch took (reference the paragraph in the documentation you linked to, starting at line 449).

There are obviously two email addresses which refer to me.

Would you be willing to clarify the proposed change possibility another bit? (Would another patch variant become relevant for the affected software component at all?)

Regards,
Markus