All of lore.kernel.org
 help / color / mirror / Atom feed
From: Markus Elfring <Markus.Elfring@web.de>
To: sparclinux@vger.kernel.org,
	Alexandre Belloni <alexandre.belloni@bootlin.com>,
	Andreas Larsson <andreas@gaisler.com>,
	Christoph Lameter <cl@linux.com>,
	"David S. Miller" <davem@davemloft.net>,
	Finn Thain <fthain@linux-m68k.org>,
	Geert Uytterhoeven <geert@linux-m68k.org>,
	Tejun Heo <tj@kernel.org>
Cc: LKML <linux-kernel@vger.kernel.org>,
	kernel-janitors@vger.kernel.org,
	Miaoqian Lin <linmq006@gmail.com>
Subject: [PATCH] sparc: time: Use pointer from memcpy() call for assignment in setup_sparc64_timer()
Date: Fri, 31 Oct 2025 08:46:28 +0100	[thread overview]
Message-ID: <2fa899eb-60b6-4637-9035-aeff78e261fa@web.de> (raw)

From: Markus Elfring <elfring@users.sourceforge.net>
Date: Fri, 31 Oct 2025 08:36:13 +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/sparc/kernel/time_64.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/arch/sparc/kernel/time_64.c b/arch/sparc/kernel/time_64.c
index b32f27f929d1..e9c29574cd59 100644
--- a/arch/sparc/kernel/time_64.c
+++ b/arch/sparc/kernel/time_64.c
@@ -760,9 +760,7 @@ void setup_sparc64_timer(void)
 			     : /* no outputs */
 			     : "r" (pstate));
 
-	sevt = this_cpu_ptr(&sparc64_events);
-
-	memcpy(sevt, &sparc64_clockevent, sizeof(*sevt));
+	sevt = memcpy(this_cpu_ptr(&sparc64_events), &sparc64_clockevent, sizeof(*sevt));
 	sevt->cpumask = cpumask_of(smp_processor_id());
 
 	clockevents_register_device(sevt);
-- 
2.51.1


             reply	other threads:[~2025-10-31  7:46 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-10-31  7:46 Markus Elfring [this message]
2025-10-31  8:01 ` [PATCH] sparc: time: Use pointer from memcpy() call for assignment in setup_sparc64_timer() Geert Uytterhoeven
2025-10-31  8:46   ` Markus Elfring
2025-10-31  9:51     ` David Laight
2025-10-31 10:08     ` Geert Uytterhoeven
2025-10-31 11:27       ` Dan Carpenter

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=2fa899eb-60b6-4637-9035-aeff78e261fa@web.de \
    --to=markus.elfring@web.de \
    --cc=alexandre.belloni@bootlin.com \
    --cc=andreas@gaisler.com \
    --cc=cl@linux.com \
    --cc=davem@davemloft.net \
    --cc=fthain@linux-m68k.org \
    --cc=geert@linux-m68k.org \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=linmq006@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=sparclinux@vger.kernel.org \
    --cc=tj@kernel.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.