mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Markus Elfring <Markus.Elfring@web.de>
To: linux-mips@vger.kernel.org,
	"David S. Miller" <davem@davemloft.net>,
	"Florian Fainelli" <florian@openwrt.org>,
	"Maxime Bizon" <mbizon@freebox.fr>,
	"Thomas Bogendörfer" <tsbogend@alpha.franken.de>
Cc: LKML <linux-kernel@vger.kernel.org>,
	kernel-janitors@vger.kernel.org,
	Miaoqian Lin <linmq006@gmail.com>
Subject: [PATCH] MIPS: BCM63xx: Use pointer from memcpy() call for assignment in bcm63xx_enet_register()
Date: Thu, 30 Oct 2025 20:38:47 +0100	[thread overview]
Message-ID: <2f7c926a-6a23-4b60-b905-859645026e4a@web.de> (raw)

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


                 reply	other threads:[~2025-10-30 19:38 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=2f7c926a-6a23-4b60-b905-859645026e4a@web.de \
    --to=markus.elfring@web.de \
    --cc=davem@davemloft.net \
    --cc=florian@openwrt.org \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=linmq006@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mips@vger.kernel.org \
    --cc=mbizon@freebox.fr \
    --cc=tsbogend@alpha.franken.de \
    /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®