From: Dan Carpenter <dan.carpenter@linaro.org>
To: Julia Lawall <julia.lawall@inria.fr>
Cc: Markus Elfring <Markus.Elfring@web.de>,
cocci@inria.fr, LKML <linux-kernel@vger.kernel.org>,
kernel-janitors@vger.kernel.org,
Miaoqian Lin <linmq006@gmail.com>
Subject: Re: [cocci] [RFC] Increasing usage of direct pointer assignments from memcpy() calls with SmPL?
Date: Thu, 30 Oct 2025 16:47:37 +0300 [thread overview]
Message-ID: <aQNsecHJSO2U68Fc@stanley.mountain> (raw)
In-Reply-To: <aa99eded-be51-af3b-414-7c3bbaddea4a@inria.fr>
On Thu, Oct 30, 2025 at 01:31:49PM +0100, Julia Lawall wrote:
>
>
> On Thu, 30 Oct 2025, Markus Elfring wrote:
> > @@ -2600,8 +2600,8 @@ static int __init init_hyp_mode(void)
> > goto out_err;
> > }
> >
> > + memcpy(page_address(page), CHOOSE_NVHE_SYM(__per_cpu_start), nvhe_percpu_size());
> > page_addr = page_address(page);
> > - memcpy(page_addr, CHOOSE_NVHE_SYM(__per_cpu_start), nvhe_percpu_size());
> > kvm_nvhe_sym(kvm_arm_hyp_percpu_base)[cpu] = (unsigned long)page_addr;
> > }
>
> Not sure what is the point of all this. Try:
>
> - target = object; memcpy(target, source, size);
> + target = memcpy(target, source, size);
No one will thank you for making these changes... :( Please don't do
it.
regards,
dan carpenter
next prev parent reply other threads:[~2025-10-30 14:27 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-10-29 19:56 [cocci] [RFC] Increasing usage of direct pointer assignments from memcpy() calls with SmPL? Markus Elfring
2025-10-29 19:56 ` Markus Elfring
2025-10-29 21:24 ` [cocci] " Julia Lawall
2025-10-30 9:33 ` Markus Elfring
2025-10-30 10:12 ` Julia Lawall
2025-10-30 10:19 ` Markus Elfring
2025-10-30 10:32 ` Julia Lawall
2025-10-30 12:26 ` Markus Elfring
2025-10-30 12:31 ` Julia Lawall
2025-10-30 13:35 ` Markus Elfring
2025-10-30 13:38 ` Julia Lawall
2025-10-30 13:47 ` Dan Carpenter [this message]
2025-10-30 13:58 ` Markus Elfring
2025-10-31 6:00 ` Markus Elfring
2025-10-30 14:06 ` Markus Elfring
2025-10-30 14:14 ` Julia Lawall
2025-10-30 14:22 ` Markus Elfring
2025-10-31 16:57 ` Markus Elfring
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=aQNsecHJSO2U68Fc@stanley.mountain \
--to=dan.carpenter@linaro.org \
--cc=Markus.Elfring@web.de \
--cc=cocci@inria.fr \
--cc=julia.lawall@inria.fr \
--cc=kernel-janitors@vger.kernel.org \
--cc=linmq006@gmail.com \
--cc=linux-kernel@vger.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.