* [PATCH] atm: solos-pci: Use pointer from memcpy() call for assignment in fpga_tx()
@ 2025-10-31 11:42 Markus Elfring
2025-11-03 14:32 ` Simon Horman
0 siblings, 1 reply; 2+ messages in thread
From: Markus Elfring @ 2025-10-31 11:42 UTC (permalink / raw)
To: linux-atm-general, netdev, Chas Williams, David S. Miller,
David Woodhouse
Cc: LKML, kernel-janitors, Miaoqian Lin
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Fri, 31 Oct 2025 12:30:38 +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/atm/solos-pci.c | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/drivers/atm/solos-pci.c b/drivers/atm/solos-pci.c
index d3c30a28c410..dc4aa803f3d6 100644
--- a/drivers/atm/solos-pci.c
+++ b/drivers/atm/solos-pci.c
@@ -1087,10 +1087,11 @@ static uint32_t fpga_tx(struct solos_card *card)
oldskb = skb; /* We're done with this skb already */
} else if (skb && card->using_dma) {
unsigned char *data = skb->data;
- if ((unsigned long)data & card->dma_alignment) {
- data = card->dma_bounce + (BUF_SIZE * port);
- memcpy(data, skb->data, skb->len);
- }
+
+ if ((unsigned long)data & card->dma_alignment)
+ data = memcpy(card->dma_bounce + (BUF_SIZE * port),
+ skb->data, skb->len);
+
SKB_CB(skb)->dma_addr = dma_map_single(&card->dev->dev, data,
skb->len, DMA_TO_DEVICE);
card->tx_skb[port] = skb;
--
2.51.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] atm: solos-pci: Use pointer from memcpy() call for assignment in fpga_tx()
2025-10-31 11:42 [PATCH] atm: solos-pci: Use pointer from memcpy() call for assignment in fpga_tx() Markus Elfring
@ 2025-11-03 14:32 ` Simon Horman
0 siblings, 0 replies; 2+ messages in thread
From: Simon Horman @ 2025-11-03 14:32 UTC (permalink / raw)
To: Markus Elfring
Cc: linux-atm-general, netdev, Chas Williams, David S. Miller,
David Woodhouse, LKML, kernel-janitors, Miaoqian Lin
On Fri, Oct 31, 2025 at 12:42:09PM +0100, Markus Elfring wrote:
> From: Markus Elfring <elfring@users.sourceforge.net>
> Date: Fri, 31 Oct 2025 12:30:38 +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>
Quoting documentation:
1.6.6. Clean-up patches¶
Netdev discourages patches which perform simple clean-ups, which are not in
the context of other work. For example:
* Addressing checkpatch.pl, and other trivial coding style warnings
* Addressing Local variable ordering issues
* Conversions to device-managed APIs (devm_ helpers)
This is because it is felt that the churn that such changes produce comes
at a greater cost than the value of such clean-ups.
Conversely, spelling and grammar fixes are not discouraged.
https://docs.kernel.org/6.18-rc4/process/maintainer-netdev.html#clean-up-patches
--
pw-bot: rejected
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2025-11-03 14:32 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-10-31 11:42 [PATCH] atm: solos-pci: Use pointer from memcpy() call for assignment in fpga_tx() Markus Elfring
2025-11-03 14:32 ` Simon Horman
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).