From: Markus Elfring <Markus.Elfring@web.de>
To: Gautam Menghani <gautam@linux.ibm.com>,
linuxppc-dev@lists.ozlabs.org, kvm@vger.kernel.org
Cc: Alexander Graf <agraf@suse.de>,
Christophe Leroy <christophe.leroy@csgroup.eu>,
Madhavan Srinivasan <maddy@linux.ibm.com>,
Michael Ellerman <mpe@ellerman.id.au>,
Nicholas Piggin <npiggin@gmail.com>,
LKML <linux-kernel@vger.kernel.org>,
kernel-janitors@vger.kernel.org,
Miaoqian Lin <linmq006@gmail.com>
Subject: Re: [PATCH] KVM: PPC: Use pointer from memcpy() call for assignment in kvmppc_kvm_pv()
Date: Mon, 3 Nov 2025 08:11:33 +0100 [thread overview]
Message-ID: <7d3339b1-9088-4e46-b6c5-7d2ff075aa3c@web.de> (raw)
In-Reply-To: <aQg7msPQvAZbXs_u@Gautams-MacBook-Pro.local>
>> 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.
…>> +++ b/arch/powerpc/kvm/powerpc.c
>> @@ -216,8 +216,7 @@ int kvmppc_kvm_pv(struct kvm_vcpu *vcpu)
>>
>> shared &= PAGE_MASK;
>> shared |= vcpu->arch.magic_page_pa & 0xf000;
>> - new_shared = (void*)shared;
>> - memcpy(new_shared, old_shared, 0x1000);
>> + new_shared = memcpy(shared, old_shared, 0x1000);
>> vcpu->arch.shared = new_shared;
>> }
>> #endif
>
> This patch does not compile
…> arch/powerpc/kvm/powerpc.c: In function `kvmppc_kvm_pv´:
> arch/powerpc/kvm/powerpc.c:219:45: error: passing argument 1 of `__builtin_dynamic_object_size´ makes pointer from integer without a cast [-Wint-conversion]
…
Will another subsequent patch variant become relevant for the proposed
source code transformation approach?
Regards,
Markus
prev parent reply other threads:[~2025-11-03 7:11 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-10-30 20:51 [PATCH] KVM: PPC: Use pointer from memcpy() call for assignment in kvmppc_kvm_pv() Markus Elfring
2025-10-30 21:41 ` David Laight
2025-11-03 5:20 ` Gautam Menghani
2025-11-03 7:11 ` Markus Elfring [this message]
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=7d3339b1-9088-4e46-b6c5-7d2ff075aa3c@web.de \
--to=markus.elfring@web.de \
--cc=agraf@suse.de \
--cc=christophe.leroy@csgroup.eu \
--cc=gautam@linux.ibm.com \
--cc=kernel-janitors@vger.kernel.org \
--cc=kvm@vger.kernel.org \
--cc=linmq006@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=maddy@linux.ibm.com \
--cc=mpe@ellerman.id.au \
--cc=npiggin@gmail.com \
/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;
as well as URLs for NNTP newsgroup(s).