[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <7d3339b1-9088-4e46-b6c5-7d2ff075aa3c@web.de>
Date: Mon, 3 Nov 2025 08:11:33 +0100
From: Markus Elfring <Markus.Elfring@....de>
To: Gautam Menghani <gautam@...ux.ibm.com>, linuxppc-dev@...ts.ozlabs.org,
kvm@...r.kernel.org
Cc: Alexander Graf <agraf@...e.de>,
Christophe Leroy <christophe.leroy@...roup.eu>,
Madhavan Srinivasan <maddy@...ux.ibm.com>,
Michael Ellerman <mpe@...erman.id.au>, Nicholas Piggin <npiggin@...il.com>,
LKML <linux-kernel@...r.kernel.org>, kernel-janitors@...r.kernel.org,
Miaoqian Lin <linmq006@...il.com>
Subject: Re: [PATCH] KVM: PPC: Use pointer from memcpy() call for assignment
in kvmppc_kvm_pv()
>> 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
Powered by blists - more mailing lists