Re: [RESEND PATCH v3 1/2] kho: add KHOSER_COPY_TYPE(UN)SAFE for phys copy

[email protected]
Newsgroups org.infradead.lists.kexec,org.kernel.vger.linux-kernel,org.kvack.linux-mm
Message-ID <[email protected]>
Mike Rapoport <[email protected]> writes:

> On Mon, 22 Jun 2026 11:12:14 +0000, Tarun Sahu <[email protected]> wrote:
>> diff --git a/include/linux/kho/abi/kexec_handover.h b/include/linux/kho/abi/kexec_handover.h
>> index 5e2eb8519bda..618408fbe9c9 100644
>> --- a/include/linux/kho/abi/kexec_handover.h
>> +++ b/include/linux/kho/abi/kexec_handover.h
>> @@ -139,6 +139,18 @@
>>  		(typeof((s).ptr))((s).phys ? phys_to_virt((s).phys) : NULL); \
>>  	})
>>  
>> +/* Copies one serializable pointer to another of same type. */
>> +#define KHOSER_COPY_TYPESAFE(dest, src) \
>
> Maybe name if KHOSER_COPY_PTR?
>
>> +	({ \
>> +		typecheck(typeof((dest).ptr), (src).ptr); \
>
> And if we could replace the typecheck with some other magic to allow
> void * we won't need the unsafe version.

Done! Sent V4.
Thanks for reviewing.

~Tarun

>
> -- 
> Sincerely yours,
> Mike.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.