[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <17da2cdc-7fdd-43d1-91d5-36425615588a@web.de>
Date: Fri, 31 Oct 2025 10:44:37 +0100
From: Markus Elfring <Markus.Elfring@....de>
To: Naman Jain <namjain@...ux.microsoft.com>, linux-hyperv@...r.kernel.org,
x86@...nel.org, Borislav Petkov <bp@...en8.de>,
Dave Hansen <dave.hansen@...ux.intel.com>, Dexuan Cui <decui@...rosoft.com>,
Haiyang Zhang <haiyangz@...rosoft.com>, "H. Peter Anvin" <hpa@...or.com>,
Ingo Molnar <mingo@...hat.com>, "K. Y. Srinivasan" <kys@...rosoft.com>,
Long Li <longli@...rosoft.com>, Mukesh Rathor <mrathor@...ux.microsoft.com>,
Thomas Gleixner <tglx@...utronix.de>, Wei Liu <wei.liu@...nel.org>
Cc: LKML <linux-kernel@...r.kernel.org>, kernel-janitors@...r.kernel.org,
Miaoqian Lin <linmq006@...il.com>
Subject: Re: [PATCH] x86/hyperv: Use pointer from memcpy() call for assignment
in hv_crash_setup_trampdata()
…>> +++ b/arch/x86/hyperv/hv_crash.c
>> @@ -464,9 +464,7 @@ static int hv_crash_setup_trampdata(u64 trampoline_va)
>> return -1;
>> }
>> - dest = (void *)trampoline_va;
>> - memcpy(dest, &hv_crash_asm32, size);
>> -
>> + dest = memcpy((void *)trampoline_va, &hv_crash_asm32, size);
>> dest += size;
>> dest = (void *)round_up((ulong)dest, 16);
>> tramp = (struct hv_crash_tramp_data *)dest;
>
>
> I tried running spatch Coccinelle checks on this file, but could not get it to flag this improvement.
The proposed source code transformation is not supported by a coccicheck script so far.
> Do you mind sharing more details on the issue reproduction please.
Would you like to take another look at corresponding development discussions?
Example:
[RFC] Increasing usage of direct pointer assignments from memcpy() calls with SmPL?
https://lore.kernel.org/cocci/ddc8654a-9505-451f-87ad-075bfa646381@web.de/
https://sympa.inria.fr/sympa/arc/cocci/2025-10/msg00049.html
> I am OK with this change,
Thanks for a bit of positive feedback.
> though it may cost code readability a little bit.
Would you complain about other variable assignments in such a direction?
Regards,
Markus
Powered by blists - more mailing lists