mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] MIPS: BCM63xx: Use pointer from memcpy() call for assignment in bcm63xx_enet_register()
@ 2025-10-30 19:38 Markus Elfring
  0 siblings, 0 replies; only message in thread
From: Markus Elfring @ 2025-10-30 19:38 UTC (permalink / raw)
  To: linux-mips, David S. Miller, Florian Fainelli, Maxime Bizon,
	Thomas Bogendörfer
  Cc: LKML, kernel-janitors, Miaoqian Lin

From: Markus Elfring <elfring@users.sourceforge.net>
Date: Thu, 30 Oct 2025 20:32:07 +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>
---
 arch/mips/bcm63xx/dev-enet.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/arch/mips/bcm63xx/dev-enet.c b/arch/mips/bcm63xx/dev-enet.c
index 8e73d65f3480..7a17135e8f13 100644
--- a/arch/mips/bcm63xx/dev-enet.c
+++ b/arch/mips/bcm63xx/dev-enet.c
@@ -243,8 +243,7 @@ int __init bcm63xx_enet_register(int unit,
 	}
 
 	/* copy given platform data */
-	dpd = pdev->dev.platform_data;
-	memcpy(dpd, pd, sizeof(*pd));
+	dpd = memcpy(pdev->dev.platform_data, pd, sizeof(*pd));
 
 	/* adjust them in case internal phy is used */
 	if (dpd->use_internal_phy) {
-- 
2.51.1


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2025-10-30 19:38 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-10-30 19:38 [PATCH] MIPS: BCM63xx: Use pointer from memcpy() call for assignment in bcm63xx_enet_register() Markus Elfring

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®